Saltar al contenido principal
POST
/
v1
/
workflows
Crear un workflow
curl --request POST \
  --url https://flowker.sandbox.lerian.net/v1/workflows \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "name": "Payment Notification Flow",
  "description": "Receives a webhook trigger and logs the payment event.",
  "nodes": [
    {
      "id": "trigger-1",
      "type": "trigger",
      "name": "Webhook Trigger",
      "position": {
        "x": 0,
        "y": 0
      },
      "data": {
        "triggerId": "webhook"
      }
    },
    {
      "id": "log-event",
      "type": "action",
      "name": "Log Payment Event",
      "position": {
        "x": 200,
        "y": 0
      },
      "data": {
        "action": "log"
      }
    }
  ],
  "edges": [
    {
      "id": "e1",
      "source": "trigger-1",
      "target": "log-event"
    }
  ],
  "metadata": {
    "team": "payments",
    "environment": "sandbox"
  }
}
'
{
  "createdAt": "2026-03-17T14:30:00Z",
  "status": "draft",
  "version": "1.0.0",
  "workflowId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}

Autorizaciones

X-API-Key
string
header
requerido

API key for authenticating requests to the Flowker API. Provisioned via the API_KEY environment variable during deployment.

Cuerpo

application/json

Cuerpo de la solicitud que contiene la definición del workflow.

name
string
requerido

Nombre único para el workflow.

Required string length: 1 - 100
Ejemplo:

"Payment Notification Flow"

description
string

Descripción opcional legible por humanos del propósito del workflow.

Maximum string length: 500
Ejemplo:

"Receives a webhook trigger and logs the payment event."

edges
object[]

Conexiones entre nodos que definen el flujo de ejecución. Cada arista vincula un nodo de origen a un nodo de destino, opcionalmente con una condición.

Maximum array length: 200
metadata
object

Pares clave-valor personalizados para etiquetar o categorizar el workflow.

Ejemplo:
{
"team": "payments",
"environment": "sandbox"
}
nodes
object[]

Los pasos que componen este workflow. Cada nodo es una unidad de trabajo: un disparador, una llamada a ejecutor, una rama condicional o una acción.

Maximum array length: 100

Respuesta

Indica que el recurso fue creado exitosamente y la operación se completó según lo esperado.

createdAt
string<date-time>

Marca de tiempo de cuando se creó el workflow.

Ejemplo:

"2026-03-17T14:30:00Z"

status
string

Estado inicial del workflow (siempre draft al crear).

Ejemplo:

"draft"

version
string

Versión de la definición del workflow.

Ejemplo:

"1.0.0"

workflowId
string<uuid>

Identificador único del workflow creado.

Ejemplo:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"