Run Flow By Id

Description

The Run Flow by Id endpoint runs a flow on an agent by creating a temporary schedule, using the flowId and agentId. The response is a runId, which is a unique value for a specific run of the triggered schedule. 

flowId can be fetched by passing flowId to the Get Hierarchy endpoint.

This endpoint can be used to rerun failed tests or a single test on a specific agent. 

Examples

http://{controllerMachine}:{controllerPort}/api/v4/flows/39f2b3e3-fa24-43e7-a2d6-38815128ac6c/agent/69f7b3e7-ha24-83e7-a2d6-98895128vc6z?var1=val1&var2=val2   

From the previous endpoint example, if the variables are defined in the schedule configuration, the value of var1 and var2 will be set to val1 and val2 respectively. Schedule variables can be used dynamically in automation flows. This method is used to input values and parameters directly into the individual automation flows via the schedule.

Request URL

http://{controllerMachine}:{controllerPort}/api/v4/flows/{infoId}/agent/{agentId}

Input parameters

Property Type Description Comments
InfoId string Unique identifier for a flow A user can pass the flowId to the Get Hierarchy endpoint and get the InfoId
agentId string Unique identifier for a agent It can be fetched by right-clicking on an agent and by clicking Get Id

Examples

CURL

curl -X PUT --header 'Accept: application/json' --header 'AccessKey: Mo87Nc4qDAtzJNDb' 'http:// {controllerMachine}:{controllerPort} /api/v4/flows/39f2b3e3-fa24-43e7-a2d6-38815128ac6c/agent/69f7b3e7-ha24-83e7-a2d6-98895128vc6z'

PowerShell 

$headers = @{}

$headers.Add("AccessKey","Mo87Nc4qDAtzJNDb")

Invoke-WebRequest -Uri "http://{controllerMachine}:{controllerPort}/api/v4/flows/39f2b3e3-fa24-43e7-a2d6-38815128ac6c/agent/69f7b3e7-ha24-83e7-a2d6-98895128vc6z" -ContentType "application/json" -Headers $headers -Method PUT 

Response

The schedule RunId is returned in this response:

{
"$id": "1",
"RunId": "da6845c9-ae69-45d3-b100-795a3b866623"
}

Response object

Field Type Description Comments
runId string The runId is a unique Id for the individual run instance of a schedule runId can be used to fetch information about the execution output of flows defined in a schedule

Response Code

List of response codes:

200 (OK)

404 (Not Found)

401 (Unauthorized)

400 (Bad Request)

405 (Method Not Allowed)

500 (Internal Server Error)