Skip to main content
Version: Current

Job.ExecuteJobV2Async

Description​

The Smart Buddy executes an existing job with job details provided by the connected AI Command Center.

Signature [C#]​

Task<JobInfo> ExecuteJobV2Async(Dictionary<string, object> inputArgs, int processId, int? botId = null, string logLevel = "Information");

Properties​

Input​

ParameterTypeRequired / defaultDescription
inputArgsDictionary<string, object>RequiredSpecify the job input arguments.
processIdintRequiredSpecify the ProcessId to execute the job.
botIdint?Optional; nullSpecify the SmartBuddy Id to execute the job.
logLevelstringOptional; "Information"Specify the job log level.

Output​

PropertyDescription
Task<JobInfo>Returns the job information of a current job.

Remarks​

Use ExecuteJobV2Async API to execute the job from the connected AI Command Center.

Example​

C#
public async Task ExecuteJob()
{
IControlRoomContext context = LoginControlRoom();
try
{
int processId = 1;
int botId = 1;
string logLevel = "Information";
Dictionary<string, object> inputArgs = new Dictionary<string, object>();
// Add entries whose names and types match the process input arguments.
JobInfo jobInfo = await context.Jobs.ExecuteJobV2Async(inputArgs, processId, botId, logLevel);
Console.WriteLine("JobId: " + jobInfo.JobId + ", Output: " + jobInfo.Output);
}
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.