curl --request POST \
--url https://v1.api.altostrat.io/workflows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "New Customer Onboarding",
"description": "Sends a welcome email when a new site is created.",
"is_active": true,
"authorization_id": "auth_01H...",
"schedule_type": "manual",
"nodes": [
{
"id": "n1",
"type": "manual_trigger",
"position": {
"x": 100,
"y": 100
},
"data": {
"componentId": "manual_trigger",
"description": "Manually trigger this onboarding flow."
}
},
{
"id": "n2",
"type": "webhook",
"position": {
"x": 400,
"y": 100
},
"data": {
"componentId": "webhook",
"method": "POST",
"url": "https://example.com/api/welcome",
"body": "{\"message\": \"Welcome!\", \"run_id\": \"{{ n1.run_id }}\"}"
}
}
],
"edges": [
{
"id": "e1-2",
"source": "n1",
"target": "n2"
}
]
}
'import requests
url = "https://v1.api.altostrat.io/workflows"
payload = {
"name": "New Customer Onboarding",
"description": "Sends a welcome email when a new site is created.",
"is_active": True,
"authorization_id": "auth_01H...",
"schedule_type": "manual",
"nodes": [
{
"id": "n1",
"type": "manual_trigger",
"position": {
"x": 100,
"y": 100
},
"data": {
"componentId": "manual_trigger",
"description": "Manually trigger this onboarding flow."
}
},
{
"id": "n2",
"type": "webhook",
"position": {
"x": 400,
"y": 100
},
"data": {
"componentId": "webhook",
"method": "POST",
"url": "https://example.com/api/welcome",
"body": "{\"message\": \"Welcome!\", \"run_id\": \"{{ n1.run_id }}\"}"
}
}
],
"edges": [
{
"id": "e1-2",
"source": "n1",
"target": "n2"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'New Customer Onboarding',
description: 'Sends a welcome email when a new site is created.',
is_active: true,
authorization_id: 'auth_01H...',
schedule_type: 'manual',
nodes: [
{
id: 'n1',
type: 'manual_trigger',
position: {x: 100, y: 100},
data: {
componentId: 'manual_trigger',
description: 'Manually trigger this onboarding flow.'
}
},
{
id: 'n2',
type: 'webhook',
position: {x: 400, y: 100},
data: {
componentId: 'webhook',
method: 'POST',
url: 'https://example.com/api/welcome',
body: JSON.stringify('{"message": "Welcome!", "run_id": "{{ n1.run_id }}"}')
}
}
],
edges: [{id: 'e1-2', source: 'n1', target: 'n2'}]
})
};
fetch('https://v1.api.altostrat.io/workflows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://v1.api.altostrat.io/workflows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'New Customer Onboarding',
'description' => 'Sends a welcome email when a new site is created.',
'is_active' => true,
'authorization_id' => 'auth_01H...',
'schedule_type' => 'manual',
'nodes' => [
[
'id' => 'n1',
'type' => 'manual_trigger',
'position' => [
'x' => 100,
'y' => 100
],
'data' => [
'componentId' => 'manual_trigger',
'description' => 'Manually trigger this onboarding flow.'
]
],
[
'id' => 'n2',
'type' => 'webhook',
'position' => [
'x' => 400,
'y' => 100
],
'data' => [
'componentId' => 'webhook',
'method' => 'POST',
'url' => 'https://example.com/api/welcome',
'body' => '{"message": "Welcome!", "run_id": "{{ n1.run_id }}"}'
]
]
],
'edges' => [
[
'id' => 'e1-2',
'source' => 'n1',
'target' => 'n2'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://v1.api.altostrat.io/workflows"
payload := strings.NewReader("{\n \"name\": \"New Customer Onboarding\",\n \"description\": \"Sends a welcome email when a new site is created.\",\n \"is_active\": true,\n \"authorization_id\": \"auth_01H...\",\n \"schedule_type\": \"manual\",\n \"nodes\": [\n {\n \"id\": \"n1\",\n \"type\": \"manual_trigger\",\n \"position\": {\n \"x\": 100,\n \"y\": 100\n },\n \"data\": {\n \"componentId\": \"manual_trigger\",\n \"description\": \"Manually trigger this onboarding flow.\"\n }\n },\n {\n \"id\": \"n2\",\n \"type\": \"webhook\",\n \"position\": {\n \"x\": 400,\n \"y\": 100\n },\n \"data\": {\n \"componentId\": \"webhook\",\n \"method\": \"POST\",\n \"url\": \"https://example.com/api/welcome\",\n \"body\": \"{\\\"message\\\": \\\"Welcome!\\\", \\\"run_id\\\": \\\"{{ n1.run_id }}\\\"}\"\n }\n }\n ],\n \"edges\": [\n {\n \"id\": \"e1-2\",\n \"source\": \"n1\",\n \"target\": \"n2\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://v1.api.altostrat.io/workflows")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"New Customer Onboarding\",\n \"description\": \"Sends a welcome email when a new site is created.\",\n \"is_active\": true,\n \"authorization_id\": \"auth_01H...\",\n \"schedule_type\": \"manual\",\n \"nodes\": [\n {\n \"id\": \"n1\",\n \"type\": \"manual_trigger\",\n \"position\": {\n \"x\": 100,\n \"y\": 100\n },\n \"data\": {\n \"componentId\": \"manual_trigger\",\n \"description\": \"Manually trigger this onboarding flow.\"\n }\n },\n {\n \"id\": \"n2\",\n \"type\": \"webhook\",\n \"position\": {\n \"x\": 400,\n \"y\": 100\n },\n \"data\": {\n \"componentId\": \"webhook\",\n \"method\": \"POST\",\n \"url\": \"https://example.com/api/welcome\",\n \"body\": \"{\\\"message\\\": \\\"Welcome!\\\", \\\"run_id\\\": \\\"{{ n1.run_id }}\\\"}\"\n }\n }\n ],\n \"edges\": [\n {\n \"id\": \"e1-2\",\n \"source\": \"n1\",\n \"target\": \"n2\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v1.api.altostrat.io/workflows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"New Customer Onboarding\",\n \"description\": \"Sends a welcome email when a new site is created.\",\n \"is_active\": true,\n \"authorization_id\": \"auth_01H...\",\n \"schedule_type\": \"manual\",\n \"nodes\": [\n {\n \"id\": \"n1\",\n \"type\": \"manual_trigger\",\n \"position\": {\n \"x\": 100,\n \"y\": 100\n },\n \"data\": {\n \"componentId\": \"manual_trigger\",\n \"description\": \"Manually trigger this onboarding flow.\"\n }\n },\n {\n \"id\": \"n2\",\n \"type\": \"webhook\",\n \"position\": {\n \"x\": 400,\n \"y\": 100\n },\n \"data\": {\n \"componentId\": \"webhook\",\n \"method\": \"POST\",\n \"url\": \"https://example.com/api/welcome\",\n \"body\": \"{\\\"message\\\": \\\"Welcome!\\\", \\\"run_id\\\": \\\"{{ n1.run_id }}\\\"}\"\n }\n }\n ],\n \"edges\": [\n {\n \"id\": \"e1-2\",\n \"source\": \"n1\",\n \"target\": \"n2\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "fl_01h3j4k5l6m7n8p9q0r1s2t3u4",
"name": "Customer Onboarding",
"description": "Sends a welcome email and sets up an account.",
"nodes": [
{
"id": "n1",
"type": "manual_trigger",
"position": {
"x": 150,
"y": 250
},
"data": {
"componentId": "manual_trigger"
}
}
],
"edges": [
{
"id": "e1-2",
"source": "n1",
"target": "n2",
"sourceHandle": "true"
}
],
"schedule_type": "manual",
"schedule_value": "0 9 * * *",
"next_run_at": "2025-11-01T09:00:00.000000Z",
"is_active": true,
"webhook_url": "https://v1.api.altostrat.io/workflows/webhooks/whsec_abc123...",
"created_at": "2025-10-31T12:00:00.000000Z",
"updated_at": "2025-10-31T12:30:00.000000Z"
}{
"type": "invalid_request_error",
"code": "parameter_missing",
"message": "The 'name' parameter is required for this request.",
"doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}{
"type": "invalid_request_error",
"code": "parameter_missing",
"message": "The 'name' parameter is required for this request.",
"doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}{
"type": "invalid_request_error",
"code": "parameter_missing",
"message": "The 'name' parameter is required for this request.",
"doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}{
"type": "invalid_request_error",
"code": "parameter_missing",
"message": "The 'name' parameter is required for this request.",
"doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}Create a new workflow
Creates a new workflow definition, including its nodes and edges that define the automation graph. A valid workflow must have exactly one trigger node.
curl --request POST \
--url https://v1.api.altostrat.io/workflows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "New Customer Onboarding",
"description": "Sends a welcome email when a new site is created.",
"is_active": true,
"authorization_id": "auth_01H...",
"schedule_type": "manual",
"nodes": [
{
"id": "n1",
"type": "manual_trigger",
"position": {
"x": 100,
"y": 100
},
"data": {
"componentId": "manual_trigger",
"description": "Manually trigger this onboarding flow."
}
},
{
"id": "n2",
"type": "webhook",
"position": {
"x": 400,
"y": 100
},
"data": {
"componentId": "webhook",
"method": "POST",
"url": "https://example.com/api/welcome",
"body": "{\"message\": \"Welcome!\", \"run_id\": \"{{ n1.run_id }}\"}"
}
}
],
"edges": [
{
"id": "e1-2",
"source": "n1",
"target": "n2"
}
]
}
'import requests
url = "https://v1.api.altostrat.io/workflows"
payload = {
"name": "New Customer Onboarding",
"description": "Sends a welcome email when a new site is created.",
"is_active": True,
"authorization_id": "auth_01H...",
"schedule_type": "manual",
"nodes": [
{
"id": "n1",
"type": "manual_trigger",
"position": {
"x": 100,
"y": 100
},
"data": {
"componentId": "manual_trigger",
"description": "Manually trigger this onboarding flow."
}
},
{
"id": "n2",
"type": "webhook",
"position": {
"x": 400,
"y": 100
},
"data": {
"componentId": "webhook",
"method": "POST",
"url": "https://example.com/api/welcome",
"body": "{\"message\": \"Welcome!\", \"run_id\": \"{{ n1.run_id }}\"}"
}
}
],
"edges": [
{
"id": "e1-2",
"source": "n1",
"target": "n2"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'New Customer Onboarding',
description: 'Sends a welcome email when a new site is created.',
is_active: true,
authorization_id: 'auth_01H...',
schedule_type: 'manual',
nodes: [
{
id: 'n1',
type: 'manual_trigger',
position: {x: 100, y: 100},
data: {
componentId: 'manual_trigger',
description: 'Manually trigger this onboarding flow.'
}
},
{
id: 'n2',
type: 'webhook',
position: {x: 400, y: 100},
data: {
componentId: 'webhook',
method: 'POST',
url: 'https://example.com/api/welcome',
body: JSON.stringify('{"message": "Welcome!", "run_id": "{{ n1.run_id }}"}')
}
}
],
edges: [{id: 'e1-2', source: 'n1', target: 'n2'}]
})
};
fetch('https://v1.api.altostrat.io/workflows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://v1.api.altostrat.io/workflows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'New Customer Onboarding',
'description' => 'Sends a welcome email when a new site is created.',
'is_active' => true,
'authorization_id' => 'auth_01H...',
'schedule_type' => 'manual',
'nodes' => [
[
'id' => 'n1',
'type' => 'manual_trigger',
'position' => [
'x' => 100,
'y' => 100
],
'data' => [
'componentId' => 'manual_trigger',
'description' => 'Manually trigger this onboarding flow.'
]
],
[
'id' => 'n2',
'type' => 'webhook',
'position' => [
'x' => 400,
'y' => 100
],
'data' => [
'componentId' => 'webhook',
'method' => 'POST',
'url' => 'https://example.com/api/welcome',
'body' => '{"message": "Welcome!", "run_id": "{{ n1.run_id }}"}'
]
]
],
'edges' => [
[
'id' => 'e1-2',
'source' => 'n1',
'target' => 'n2'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://v1.api.altostrat.io/workflows"
payload := strings.NewReader("{\n \"name\": \"New Customer Onboarding\",\n \"description\": \"Sends a welcome email when a new site is created.\",\n \"is_active\": true,\n \"authorization_id\": \"auth_01H...\",\n \"schedule_type\": \"manual\",\n \"nodes\": [\n {\n \"id\": \"n1\",\n \"type\": \"manual_trigger\",\n \"position\": {\n \"x\": 100,\n \"y\": 100\n },\n \"data\": {\n \"componentId\": \"manual_trigger\",\n \"description\": \"Manually trigger this onboarding flow.\"\n }\n },\n {\n \"id\": \"n2\",\n \"type\": \"webhook\",\n \"position\": {\n \"x\": 400,\n \"y\": 100\n },\n \"data\": {\n \"componentId\": \"webhook\",\n \"method\": \"POST\",\n \"url\": \"https://example.com/api/welcome\",\n \"body\": \"{\\\"message\\\": \\\"Welcome!\\\", \\\"run_id\\\": \\\"{{ n1.run_id }}\\\"}\"\n }\n }\n ],\n \"edges\": [\n {\n \"id\": \"e1-2\",\n \"source\": \"n1\",\n \"target\": \"n2\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://v1.api.altostrat.io/workflows")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"New Customer Onboarding\",\n \"description\": \"Sends a welcome email when a new site is created.\",\n \"is_active\": true,\n \"authorization_id\": \"auth_01H...\",\n \"schedule_type\": \"manual\",\n \"nodes\": [\n {\n \"id\": \"n1\",\n \"type\": \"manual_trigger\",\n \"position\": {\n \"x\": 100,\n \"y\": 100\n },\n \"data\": {\n \"componentId\": \"manual_trigger\",\n \"description\": \"Manually trigger this onboarding flow.\"\n }\n },\n {\n \"id\": \"n2\",\n \"type\": \"webhook\",\n \"position\": {\n \"x\": 400,\n \"y\": 100\n },\n \"data\": {\n \"componentId\": \"webhook\",\n \"method\": \"POST\",\n \"url\": \"https://example.com/api/welcome\",\n \"body\": \"{\\\"message\\\": \\\"Welcome!\\\", \\\"run_id\\\": \\\"{{ n1.run_id }}\\\"}\"\n }\n }\n ],\n \"edges\": [\n {\n \"id\": \"e1-2\",\n \"source\": \"n1\",\n \"target\": \"n2\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v1.api.altostrat.io/workflows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"New Customer Onboarding\",\n \"description\": \"Sends a welcome email when a new site is created.\",\n \"is_active\": true,\n \"authorization_id\": \"auth_01H...\",\n \"schedule_type\": \"manual\",\n \"nodes\": [\n {\n \"id\": \"n1\",\n \"type\": \"manual_trigger\",\n \"position\": {\n \"x\": 100,\n \"y\": 100\n },\n \"data\": {\n \"componentId\": \"manual_trigger\",\n \"description\": \"Manually trigger this onboarding flow.\"\n }\n },\n {\n \"id\": \"n2\",\n \"type\": \"webhook\",\n \"position\": {\n \"x\": 400,\n \"y\": 100\n },\n \"data\": {\n \"componentId\": \"webhook\",\n \"method\": \"POST\",\n \"url\": \"https://example.com/api/welcome\",\n \"body\": \"{\\\"message\\\": \\\"Welcome!\\\", \\\"run_id\\\": \\\"{{ n1.run_id }}\\\"}\"\n }\n }\n ],\n \"edges\": [\n {\n \"id\": \"e1-2\",\n \"source\": \"n1\",\n \"target\": \"n2\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "fl_01h3j4k5l6m7n8p9q0r1s2t3u4",
"name": "Customer Onboarding",
"description": "Sends a welcome email and sets up an account.",
"nodes": [
{
"id": "n1",
"type": "manual_trigger",
"position": {
"x": 150,
"y": 250
},
"data": {
"componentId": "manual_trigger"
}
}
],
"edges": [
{
"id": "e1-2",
"source": "n1",
"target": "n2",
"sourceHandle": "true"
}
],
"schedule_type": "manual",
"schedule_value": "0 9 * * *",
"next_run_at": "2025-11-01T09:00:00.000000Z",
"is_active": true,
"webhook_url": "https://v1.api.altostrat.io/workflows/webhooks/whsec_abc123...",
"created_at": "2025-10-31T12:00:00.000000Z",
"updated_at": "2025-10-31T12:30:00.000000Z"
}{
"type": "invalid_request_error",
"code": "parameter_missing",
"message": "The 'name' parameter is required for this request.",
"doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}{
"type": "invalid_request_error",
"code": "parameter_missing",
"message": "The 'name' parameter is required for this request.",
"doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}{
"type": "invalid_request_error",
"code": "parameter_missing",
"message": "The 'name' parameter is required for this request.",
"doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}{
"type": "invalid_request_error",
"code": "parameter_missing",
"message": "The 'name' parameter is required for this request.",
"doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}Authorizations
Standard JWT for user sessions obtained via Altostrat authentication.
Body
The name for the new workflow.
"Daily Network Health Check"
The prefixed ID of the Authorization (auth_...) to use for this workflow's executions.
"auth_01H..."
The array of nodes defining the workflow logic.
1Show child attributes
Show child attributes
The array of edges connecting the workflow nodes.
Show child attributes
Show child attributes
An optional description for the workflow.
Set to false to create the workflow in an inactive state.
manual, interval, cron, daily, weekly, monthly Required if schedule_type is interval or cron.
"0 4 * * *"
Response
The workflow was created successfully.
The unique prefixed identifier for the workflow.
"fl_01h3j4k5l6m7n8p9q0r1s2t3u4"
The human-readable name of the workflow.
"Customer Onboarding"
A detailed description of what the workflow does.
"Sends a welcome email and sets up an account."
An array of node objects that make up the workflow graph. Only returned when retrieving a single workflow.
Show child attributes
Show child attributes
An array of edge objects that connect the nodes in the workflow graph. Only returned when retrieving a single workflow.
Show child attributes
Show child attributes
The type of schedule that triggers the workflow.
manual, interval, cron, daily, weekly, monthly "manual"
The value for the schedule (e.g., a cron expression or interval string like '5 minutes').
"0 9 * * *"
The next scheduled time for the workflow to run.
"2025-11-01T09:00:00.000000Z"
Indicates whether the workflow is active and can be triggered.
true
The unique, secure URL to trigger this workflow if it uses a webhook trigger.
"https://v1.api.altostrat.io/workflows/webhooks/whsec_abc123..."
The timestamp when the workflow was created.
"2025-10-31T12:00:00.000000Z"
The timestamp when the workflow was last updated.
"2025-10-31T12:30:00.000000Z"
Was this page helpful?