Skip to main content

Enriching the User Interface - .NET SDK

Temporal supports adding context to Workflows and events with metadata. This helps users identify and understand Workflows and their operations.

Adding Summary and Details to Workflows

Starting a Workflow

When starting a Workflow, you can provide a static summary and details to help identify the Workflow in the UI:

using Temporalio.Client;

// Create client
var client = await TemporalClient.ConnectAsync(new("localhost:7233"));

// Start a Workflow with static summary and details
var handle = await client.StartWorkflowAsync(
(YourWorkflow wf) => wf.RunAsync("Workflow input"),
new WorkflowOptions
{
Id = "your-Workflow-id",
TaskQueue = "your-task-queue",
StaticSummary = "Order processing for customer #12345",
StaticDetails = "Processing premium order with expedited shipping"
});

StaticSummary is a single-line description that appears in the Workflow list view, limited to 200 bytes. StaticDetails can be multi-line and provides more comprehensive information that appears in the Workflow details view, with a larger limit of 20K bytes.

The input format is standard Markdown excluding images, HTML, and scripts.

You can also use the ExecuteWorkflowAsync method with the same parameters:

var result = await client.ExecuteWorkflowAsync(
(YourWorkflow wf) => wf.RunAsync("Workflow input"),
new WorkflowOptions
{
Id = "your-Workflow-id",
TaskQueue = "your-task-queue",
StaticSummary = "Order processing for customer #12345",
StaticDetails = "Processing premium order with expedited shipping"
});

Inside the Workflow

Within a Workflow, you can get and set the current Workflow details. Unlike static summary/details set at Workflow start, this value can be updated throughout the life of the Workflow. Current Workflow details also takes Markdown format (excluding images, HTML, and scripts) and can span multiple lines.

using Temporalio.Workflows;

[Workflow]
public class YourWorkflow
{
[WorkflowRun]
public async Task<string> RunAsync(string input)
{
// Get the current details
var currentDetails = Workflow.CurrentDetails;
Workflow.Logger.LogInformation($"Current details: {currentDetails}");

// Set/update the current details
Workflow.CurrentDetails = "Updated Workflow details with new status";

return "Workflow completed";
}
}

Adding Summary to Activities and Timers

You can attach a metadata parameter Summary to Activities when starting them from within a Workflow:

using Temporalio.Activities;
using Temporalio.Workflows;

[Workflow]
public class YourWorkflow
{
[WorkflowRun]
public async Task<string> RunAsync(string input)
{
// Execute an activity with a summary
var result = await Workflow.ExecuteActivityAsync(
(YourActivities act) => act.YourActivityAsync(input),
new ActivityOptions
{
StartToCloseTimeout = TimeSpan.FromSeconds(10),
Summary = "Processing user data"
});

return result;
}
}

Similarly, you can attach a Summary to timers within a Workflow:

using Temporalio.Workflows;

[Workflow]
public class YourWorkflow
{
[WorkflowRun]
public async Task<string> RunAsync(string input)
{
// Create a timer with a summary
await Workflow.DelayWithOptionsAsync(new DelayOptions(TimeSpan.FromMinutes(5))
{
Summary = "Waiting for payment confirmation"
});

return "Timer completed";
}
}

The input format for Summary is a string, and limited to 200 bytes.

Viewing Summary and Details in the UI

Once you've added summaries and details to your Workflows, Activities, and timers, you can view this enriched information in the Temporal Web UI. Navigate to your Workflow's details page to see the metadata displayed in two key locations:

Workflow Overview Section

At the top of the Workflow details page, you'll find the Workflow-level metadata:

  • Summary & Details - Displays the static summary and static details set when starting the Workflow
  • Current Details - Displays the dynamic details that can be updated during Workflow execution

All Workflow details support standard Markdown formatting (excluding images, HTML, and scripts), allowing you to create rich, structured information displays.

Event History

Individual events in the Workflow's Event History display their associated summaries when available.

Workflow, Activity and Timer summaries appear in purple text next to their corresponding events, providing immediate context without requiring you to expand the Event details. When you do expand an Event, the summary is also prominently displayed in the detailed view.