Start or abort a flow
Control flow execution by starting or aborting a flow.
Available Actions:
start: Begin execution of a created flow (state must be 'created')abort: Cancel a running flow (state must be 'starting' or 'running')
Action: start
- Transitions flow from 'created' to 'starting' state
- Only applicable to flows without initial inputs (created via POST /flows without inputs)
- Flows created with inputs start automatically and cannot be manually started
Action: abort
- Transitions flow to 'aborting' state, then eventually to 'aborted'
- Stops processing and cleans up resources
- Cannot abort flows that are already completed or failed
Example Request:
{
"action": "start"
}
info
This endpoint allows you to start or abort a flow.
Endpoint
PATCH https://flows.generio.ai/flows/{flow_id}
Parameters
flow_id (required)
- Location: path
- Type: string
Request Body
- Schema
Properties
- action (string): Action to perform on the flow, i.e. 'start' or 'abort'.
Responses
200
Successful Response
422
Validation Error
Code Examples
Copy and run these examples in your terminal or code editor. Make sure to replace YOUR_TOKEN with your actual authentication token.
- cURL
- wget
- Python
- JavaScript
- PHP
curl -X PATCH "https://flows.generio.ai/flows/{flow_id}" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"
wget --header="Authorization: Bearer YOUR_TOKEN" \
"https://flows.generio.ai/flows/{flow_id}" -O -
import requests
url = "https://flows.generio.ai/flows/{flow_id}"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
}
response = requests.patch(url, headers=headers)
print(response.json())
const url = "https://flows.generio.ai/flows/{flow_id}";
fetch(url, {
method: "PATCH",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));
<?php
$url = "https://flows.generio.ai/flows/{flow_id}";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_TOKEN",
"Content-Type: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>