ProcessInstances.GetWorkflowInstancesByProcessInstanceIdAsync
Description
Retrieves the list of workflow instances associated with a specified process instance ID from the connected AI Command Center.
Signature [C#]
Task<List<WorkflowInstanceData>> GetWorkflowInstancesByProcessInstanceIdAsync(string instanceId);
Parameters
Input
| Property | Description |
|---|---|
instanceId | The process instance ID for which workflow instances need to be retrieved. |
Returns
| Type | Description |
|---|---|
Task<List<WorkflowInstanceData>> | A list of workflow instances associated with the specified process instance. |
Remarks
- The
instanceIdrepresents the parent process instance. - The API returns all workflow instances linked to the specified process instance.
- The operation executes asynchronously.
Use this API to retrieve workflow-level execution details within a process instance.
Example
C#
public async Task GetWorkflowInstancesByProcessInstanceId()
{
IControlRoomContext context = LoginControlRoom();
string processInstanceId = "e42a93f5d53245d788909fd655b41cfe";
List<WorkflowInstanceData> workflowInstances =
await context.ProcessInstances
.GetWorkflowInstancesByProcessInstanceIdAsync(processInstanceId);
foreach (var workflow in workflowInstances)
{
System.Console.WriteLine("Workflow Name: " + workflow.Name);
}
}
C#
public IControlRoomContext LoginControlRoom()
{
IControlRoomContext context;
string connectionString;
connectionString = "ServerUrl=https://demo.onnitellibuddies.com;UserName=demoadmin;Password=password";
context = new ControlRoomContext(connectionString);
context.Open();
return context;
}