Share via


WorkflowRunClient.GetWorkflowRun(Guid, RequestContext) Method

Definition

[Protocol Method] Get a workflow run.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual Azure.Response GetWorkflowRun (Guid workflowRunId, Azure.RequestContext context);
abstract member GetWorkflowRun : Guid * Azure.RequestContext -> Azure.Response
override this.GetWorkflowRun : Guid * Azure.RequestContext -> Azure.Response
Public Overridable Function GetWorkflowRun (workflowRunId As Guid, context As RequestContext) As Response

Parameters

workflowRunId
Guid

The workflow run id.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The response returned from the service.

Exceptions

Service returned a non-success status code.

Examples

This sample shows how to call GetWorkflowRun and parse the result.

Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
WorkflowRunClient client = new WorkflowRunClient(endpoint, credential);

Response response = client.GetWorkflowRun(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("actionDag").ToString());
Console.WriteLine(result.GetProperty("detail").GetProperty("runInput").ToString());
Console.WriteLine(result.GetProperty("detail").GetProperty("actions").ToString());

This sample shows how to call GetWorkflowRun with all parameters and parse the result.

Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
WorkflowRunClient client = new WorkflowRunClient(endpoint, credential);

Response response = client.GetWorkflowRun(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("workflowId").ToString());
Console.WriteLine(result.GetProperty("startTime").ToString());
Console.WriteLine(result.GetProperty("requestor").ToString());
Console.WriteLine(result.GetProperty("userRequestId").ToString());
Console.WriteLine(result.GetProperty("runPayload").GetProperty("type").ToString());
Console.WriteLine(result.GetProperty("runPayload").GetProperty("targetValue").ToString());
Console.WriteLine(result.GetProperty("runPayload").GetProperty("payload").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("endTime").ToString());
Console.WriteLine(result.GetProperty("cancelTime").ToString());
Console.WriteLine(result.GetProperty("cancelComment").ToString());
Console.WriteLine(result.GetProperty("actionDag").ToString());
Console.WriteLine(result.GetProperty("detail").GetProperty("runInput").ToString());
Console.WriteLine(result.GetProperty("detail").GetProperty("actions").ToString());

Applies to