Skip to main content
Version: Current

ProcessInstances.GetAllInstancesAsync

Description​

The API gets all the process instances inside the connected AI Command Center.

Signature [C#]​

Task<List<ProcessInstance>> GetAllInstancesAsync(bool isArgsRequired = true);

Properties​

Input​

ParameterTypeRequired / defaultDescription
isArgsRequiredboolOptional; trueSpecify true if you also want to retrieve the argument value.

Output​

PropertyDescription
Task<List<ProcessInstance>>Returns list of process instances.

Remarks​

Use GetAllInstancesAsync API to get all the process instances inside the connected AI Command Center.

Example​

C#
public async Task GetAllInstances()
{
IControlRoomContext context = LoginControlRoom();
try
{
List<ProcessInstance> processInstances = await context.ProcessInstances.GetAllInstancesAsync();
foreach (ProcessInstance processInstance in processInstances)
System.Console.WriteLine("Instance Name: " + processInstance.InstanceName + "\n");
}
finally
{
context.Close();
}
}
Connection helper
public IControlRoomContext LoginControlRoom()
{
string RequiredSetting(string name) => Environment.GetEnvironmentVariable(name) ?? throw new InvalidOperationException($"Set {name} before running this example.");
string serverUrl = RequiredSetting("INTELLIBUDDIES_SERVER_URL");
string userName = RequiredSetting("INTELLIBUDDIES_USERNAME");
string password = RequiredSetting("INTELLIBUDDIES_PASSWORD");
string connectionString = $"ServerUrl={serverUrl};UserName={userName};Password={password}";
IControlRoomContext context = new ControlRoomContext(connectionString);
context.Open();
return context;
}

See Get started for namespaces, configuration, and context cleanup, and SDK usage for error handling.