Skip to main content
POST
/
workflows
/
run-with-payload
/
{workflow_id}
Trigger a workflow
curl --request POST \
  --url https://api.altrina.com/workflows/run-with-payload/{workflow_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "payload": "<string>"
}
'
import requests

url = "https://api.altrina.com/workflows/run-with-payload/{workflow_id}"

payload = { "payload": "<string>" }
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({payload: '<string>'})
};

fetch('https://api.altrina.com/workflows/run-with-payload/{workflow_id}', 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://api.altrina.com/workflows/run-with-payload/{workflow_id}",
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([
'payload' => '<string>'
]),
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://api.altrina.com/workflows/run-with-payload/{workflow_id}"

payload := strings.NewReader("{\n \"payload\": \"<string>\"\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://api.altrina.com/workflows/run-with-payload/{workflow_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"payload\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.altrina.com/workflows/run-with-payload/{workflow_id}")

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 \"payload\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "status": "<string>",
  "job_id": "<string>",
  "user_id": "<string>",
  "workflow_id": "<string>",
  "conversation_id": "<string>"
}
{
"detail": "<string>",
"status_code": 123
}
{
"detail": "<string>",
"status_code": 123
}
{
"detail": "<string>",
"status_code": 123
}
{
"detail": "<string>",
"status_code": 123
}
{
"detail": "<string>",
"status_code": 123
}

Authorizations

Authorization
string
header
required

API key for authentication. Get your API key at https://app.altrina.com/settings

Path Parameters

workflow_id
string
required

The workflow ID to trigger The workflow ID to trigger. Find this in the Studio URL (e.g. app.altrina.com/gallery/studio/{workflow_id}) or pre-filled in the webhook trigger modal.

Body

application/json

Request body for triggering a workflow. The payload field is optional.

payload
string | null

Free-form text that Altrina maps into the workflow's input parameters. Omit for workflows with no inputs.

Response

Workflow triggered successfully

Response returned when a workflow is successfully triggered.

status
string
required

Always 'success' when the workflow is enqueued

job_id
string
required

Unique job identifier. Use this to poll /v1/get_job_status/{job_id}

user_id
string
required

The authenticated user who triggered the workflow

workflow_id
string
required

The workflow that was triggered

conversation_id
string
required

Conversation identifier for this workflow run