Blog
Read the latest blogs
Find tutorials, guides and use case examples in the
Learning center
The Run flow by Id endpoint runs a flow on an agent by creating a temporary schedule, using flowId and agentId. The response is a runId, which is a unique value for a specific run of the triggered schedule.
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. 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/{flowId}/agent/{agentId}
Property | Type | Description | Comments |
---|---|---|---|
InfoId | string | Unique identifier for a flow | A user can pass flowId to Get Hierarchy endpoint and get the InfoId |
agentId | string | Unique identifier for an agent | It can be fetched by right-clicking on an agent and by clicking Get Id |
isDelete | string | If isDelete is not defined => it is considered as false. If isDelete is defined i.e. (true) => it will delete the created schedule after completing the execution and Execution report will be available after deletion. |
It is an optional field |
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 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.