Skip to main content
Version: Current

ProcessInstances.GetInstanceDataAsync

Description​

The API gets process data associated with the process instance using the specified process instance ID inside the connected AI Command Center.

The response includes Workflow Data, Form Data, System Data, and Agent Data. Agent Data is scoped to the agent execution and is shared across all workflows in the process instance.

Signature [C#]​

Task<ProcessInstanceData> GetInstanceDataAsync(string instanceId);

Properties​

Input​

ParameterTypeRequired / defaultDescription
instanceIdstringRequiredThe process instance id of which the process data has to be retrieved.

Output​

PropertyDescription
Task<ProcessInstanceData>Returns the process data associated with specified process instance id, including Agent Data.

Remarks​

Use GetInstanceDataAsync API to get the process data associated with the process instance using the process instance id inside the connected AI Command Center.

Example​

C#
public async Task GetInstanceData()
{
IControlRoomContext context = LoginControlRoom();
try
{
string instanceId = "e42a93f5d53245d788909fd655b41cfe";
ProcessInstanceData data = await context.ProcessInstances.GetInstanceDataAsync(instanceId);
System.Console.WriteLine($"Form Data: {data.FormData}");
System.Console.WriteLine($"Agent Data: {data.AgentData}");
}
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.