Knowledge base
Tips and tricks Best practice guides, FAQ & more
Find tutorials, guides and use case examples in the
Learning centerThe 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.
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.
http://{controllerMachine}:{controllerPort}/api/v4/flows/{infoId}/agent/{agentId}
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 |
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'
$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
The schedule RunId is returned in this response:
{ |
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 |
List of response codes:
200 (OK)
404 (Not Found)
401 (Unauthorized)
400 (Bad Request)
405 (Method Not Allowed)
500 (Internal Server Error)
©2024, Leapwork. All rights reserved.