Vai al contenuto principale
POST
/
workflows
/
{workflowId}
/
execute
Esegui un workflow
curl --request POST \
  --url https://api.altostrat.io/workflows/{workflowId}/execute \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "context": {
    "user_id": "usr_123",
    "site_id": "site_456"
  }
}'
{
  "id": "fl_run_01h3j4k5l6m7n8p9q0r1s2t3u4",
  "status": "completed",
  "error_message": "La richiesta webhook è fallita: 503 Service Unavailable",
  "started_at": "2025-10-31T12:00:00.000000Z",
  "completed_at": "2025-10-31T12:00:05.000000Z",
  "duration_in_seconds": 5,
  "logs": [
    {
      "id": "fl_log_01h3j4k5l6m7n8p9q0r1s2t3u4",
      "node_id": "n2",
      "component_id": "webhook",
      "status": "success",
      "output": {
        "status": 200,
        "body": {
          "message": "ok"
        }
      },
      "created_at": "2025-10-31T12:00:02.000000Z"
    }
  ]
}

Authorizations

Authorization
string
header
required

JWT standard per le sessioni utente ottenuto tramite l'autenticazione Altostrat.

Path Parameters

workflowId
string
required

L'ID prefissato del workflow (es. fl_...).

Body

application/json

Un oggetto di contesto opzionale per passare dati iniziali al nodo trigger del workflow.

context
object

Una mappa chiave-valore di dati iniziali per il workflow.

Example:
{
"user_id": "usr_123",
"site_id": "site_456"
}

Response

L'esecuzione del workflow è stata accettata ed è in corso in modo asincrono.

id
string

L'identificatore univoco prefissato per l'esecuzione del workflow.

Example:

"fl_run_01h3j4k5l6m7n8p9q0r1s2t3u4"

status
enum<string>

Lo stato corrente dell'esecuzione del workflow.

Opzioni disponibili:
pending,
running,
completed,
failed,
awaiting_ui_interaction
Example:

"completed"

error_message
string | null

Se l'esecuzione è fallita, questo campo contiene il messaggio di errore.

Example:

"La richiesta webhook è fallita: 503 Service Unavailable"

started_at
string<date-time>

La data e ora di inizio dell'esecuzione del workflow.

Example:

"2025-10-31T12:00:00.000000Z"

completed_at
string<date-time> | null

La data e ora di fine dell'esecuzione del workflow (completata o fallita).

Example:

"2025-10-31T12:00:05.000000Z"

duration_in_seconds
number | null

La durata totale dell'esecuzione del workflow in secondi.

Example:

5

logs
object[]

Un elenco ordinato di voci di log fornite per ogni passo dell'esecuzione. Restituito solo quando si recupera una singola esecuzione.