Skip to main content
Version: Current

ProcessInstances.CreateAsync

Description​

The API creates a process instance with the specified details inside the connected AI Command Center.

Signature [C#]​

Task<string> CreateAsync(ProcessCreationParameters parameters);

Properties​

Input​

ParameterTypeRequired / defaultDescription
parametersProcessCreationParametersRequiredThe process instance details to be created.

Output​

PropertyDescription
stringReturns newly created process instance id.

Remarks​

Use CreateAsync API to create a new process instance inside the connected AI Command Center.

Example​

C#
public async Task CreateProcessInstance()
{
IControlRoomContext context = LoginControlRoom();
try
{
ProcessCreationParameters parameters = new ProcessCreationParameters()
{
ProcessId = 9,
ProcessInstanceName = "DemoProcessInstance"
};
string instanceId = await context.ProcessInstances.CreateAsync(parameters);
System.Console.WriteLine("Process Instance Id: " + instanceId);
}
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.