WorkflowRunsClient.GetWorkflowRuns Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
[Protocol Method] List workflow runs.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual Azure.Pageable<BinaryData> GetWorkflowRuns (string viewMode, string timeWindow, string orderby, System.Collections.Generic.IEnumerable<string> runStatuses, System.Collections.Generic.IEnumerable<string> workflowIds, System.Collections.Generic.IEnumerable<string> requestors, int? maxpagesize, Azure.RequestContext context);
abstract member GetWorkflowRuns : string * string * string * seq<string> * seq<string> * seq<string> * Nullable<int> * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetWorkflowRuns : string * string * string * seq<string> * seq<string> * seq<string> * Nullable<int> * Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetWorkflowRuns (viewMode As String, timeWindow As String, orderby As String, runStatuses As IEnumerable(Of String), workflowIds As IEnumerable(Of String), requestors As IEnumerable(Of String), maxpagesize As Nullable(Of Integer), context As RequestContext) As Pageable(Of BinaryData)
Parameters
- viewMode
- String
To filter user's workflow runs or view as admin.
- timeWindow
- String
Time window of filtering items. Allowed values: "1d" | "7d" | "30d" | "90d".
- orderby
- String
The key word which used to sort the results. Allowed values: "status desc" | "status asc" | "requestor desc" | "requestor asc" | "startTime desc" | "startTime asc" | "createdTime desc" | "createdTime asc".
- runStatuses
- IEnumerable<String>
Filter workflow runs by workflow run status.
- workflowIds
- IEnumerable<String>
Filter items by workflow id list.
- requestors
- IEnumerable<String>
Requestors' ids to filter.
The maximum page size to get the items at one time. The default value is 100.
- context
- RequestContext
The request context, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The Pageable<T> from the service containing a list of BinaryData objects. Details of the body schema for each item in the collection are in the Remarks section below.
Exceptions
Service returned a non-success status code.
Examples
This sample shows how to call GetWorkflowRuns and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
WorkflowRunsClient client = new WorkflowRunsClient(endpoint, credential);
foreach (BinaryData item in client.GetWorkflowRuns(null, null, null, null, null, null, null, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).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("runPayload").GetProperty("type").ToString());
Console.WriteLine(result.GetProperty("runPayload").GetProperty("targetValue").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
}
This sample shows how to call GetWorkflowRuns with all parameters and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
WorkflowRunsClient client = new WorkflowRunsClient(endpoint, credential);
foreach (BinaryData item in client.GetWorkflowRuns("<viewMode>", "1d", "status desc", new string[] { "InProgress" }, new string[] { "<workflowIds>" }, new string[] { "<requestors>" }, 1234, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).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("status").ToString());
Console.WriteLine(result.GetProperty("endTime").ToString());
Console.WriteLine(result.GetProperty("cancelTime").ToString());
Console.WriteLine(result.GetProperty("cancelComment").ToString());
}
Applies to
Azure SDK for .NET