Skip to main content
Version: Current

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

PropertyDescription
instanceIdThe process instance ID for which workflow instances need to be retrieved.

Returns

TypeDescription
Task<List<WorkflowInstanceData>>A list of workflow instances associated with the specified process instance.

Remarks

  • The instanceId represents 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;
}