Share via


WorkflowClient.GetWorkflow(Guid, RequestContext) Method

Definition

[Protocol Method] Get a specific workflow.

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

Parameters

workflowId
Guid

The workflow 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 GetWorkflow and parse the result.

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

Response response = client.GetWorkflow(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("id").ToString());
Console.WriteLine(result.GetProperty("triggers")[0].GetProperty("type").ToString());
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("isEnabled").ToString());
Console.WriteLine(result.GetProperty("description").ToString());

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

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

Response response = client.GetWorkflow(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("id").ToString());
Console.WriteLine(result.GetProperty("triggers")[0].GetProperty("type").ToString());
Console.WriteLine(result.GetProperty("triggers")[0].GetProperty("underGlossaryHierarchy").ToString());
Console.WriteLine(result.GetProperty("triggers")[0].GetProperty("underCollection").ToString());
Console.WriteLine(result.GetProperty("triggers")[0].GetProperty("underGlossary").ToString());
Console.WriteLine(result.GetProperty("createdTime").ToString());
Console.WriteLine(result.GetProperty("createdBy").ToString());
Console.WriteLine(result.GetProperty("lastUpdateTime").ToString());
Console.WriteLine(result.GetProperty("updatedBy").ToString());
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("isEnabled").ToString());
Console.WriteLine(result.GetProperty("description").ToString());

Applies to