Saltar al contenido principal

Workflow

Workflow

Flujo automatizado compuesto por pasos conectados.

idstring

Identificador único del workflow.

Example: wf_1B2M2Y8AsgTpgAmY7PhCfg
namestring

Nombre del workflow.

Example: Flujo de revisión legal DSR
descriptionstringnullable

Descripción del workflow.

Example: Orquesta revisión legal y transición de estado
statusstring

Estado de publicación del workflow.

Possible values: [draft, published]

Example: draft
runs_countinteger

Cantidad total de ejecuciones históricas del workflow.

Example: 42
created_by objectnullable
idstring

Identificador único del usuario de empresa que creó el workflow.

Example: cusr_1B2M2Y8AsgTpgAmY7PhCfg
namestring

Nombre del usuario de empresa.

Example: Catalina Sepúlveda
emailstring

Email del usuario de empresa.

Example: catalina@company.com
settings object
failure_alerts object
enabledboolean

Envía un correo cuando una ejecución del workflow termina en estado failed.

Example: false
starting_step_idstringnullable

ID del paso inicial. Debe apuntar a un bloque trigger.

Example: 66f01d4f1d0b5a4f7a9c1111
steps object[]

Pasos que componen el workflow.

  • Array [
  • oneOf
    idstringrequired

    ID del paso (Mongoid embedded document id).

    Example: 66f01d4f1d0b5a4f7a9c1111
    typestringrequired
    Constant value: ActionBlock
    next_step_idstringnullable

    Siguiente paso para secuencia lineal.

    Example: 66f01d4f1d0b5a4f7a9c2222
    created_atstring<date-time>
    Example: 2024-03-21T10:00:00Z
    updated_atstring<date-time>
    Example: 2024-03-21T10:05:00Z
  • ]
  • created_atstring<date-time>
    Example: 2024-03-21T10:00:00Z
    updated_atstring<date-time>
    Example: 2024-03-21T10:05:00Z
    Workflow
    {
    "id": "wf_1B2M2Y8AsgTpgAmY7PhCfg",
    "name": "Flujo de revisión legal DSR",
    "description": "Orquesta revisión legal y transición de estado",
    "status": "draft",
    "runs_count": 42,
    "created_by": {
    "id": "cusr_1B2M2Y8AsgTpgAmY7PhCfg",
    "name": "Catalina Sepúlveda",
    "email": "catalina@company.com"
    },
    "settings": {
    "failure_alerts": {
    "enabled": false
    }
    },
    "starting_step_id": "66f01d4f1d0b5a4f7a9c1111",
    "steps": [
    {
    "id": "66f01d4f1d0b5a4f7a9c1111",
    "type": "string",
    "next_step_id": "66f01d4f1d0b5a4f7a9c2222",
    "created_at": "2024-03-21T10:00:00Z",
    "updated_at": "2024-03-21T10:05:00Z"
    },
    {
    "id": "66f01d4f1d0b5a4f7a9c1111",
    "type": "string",
    "next_step_id": "66f01d4f1d0b5a4f7a9c2222",
    "created_at": "2024-03-21T10:00:00Z",
    "updated_at": "2024-03-21T10:05:00Z",
    "conditions": [
    {
    "id": "66f01d4f1d0b5a4f7a9c6666",
    "expression": "legal_review_approved == true",
    "step_id": "66f01d4f1d0b5a4f7a9c4444",
    "_destroy": false
    }
    ],
    "else_step_id": "66f01d4f1d0b5a4f7a9c5555"
    },
    {
    "id": "66f01d4f1d0b5a4f7a9c1111",
    "type": "string",
    "next_step_id": "66f01d4f1d0b5a4f7a9c2222",
    "created_at": "2024-03-21T10:00:00Z",
    "updated_at": "2024-03-21T10:05:00Z",
    "condition": {
    "id": "66f01d4f1d0b5a4f7a9c6666",
    "expression": "legal_review_approved == true",
    "step_id": "66f01d4f1d0b5a4f7a9c4444",
    "_destroy": false
    }
    },
    {
    "id": "66f01d4f1d0b5a4f7a9c1111",
    "type": "string",
    "next_step_id": "66f01d4f1d0b5a4f7a9c2222",
    "created_at": "2024-03-21T10:00:00Z",
    "updated_at": "2024-03-21T10:05:00Z",
    "branch_slots": [
    {
    "id": "66f01d4f1d0b5a4f7a9c4444",
    "step_id": "66f01d4f1d0b5a4f7a9c2222"
    }
    ]
    },
    {
    "id": "66f01d4f1d0b5a4f7a9c1111",
    "type": "string",
    "next_step_id": "66f01d4f1d0b5a4f7a9c2222",
    "created_at": "2024-03-21T10:00:00Z",
    "updated_at": "2024-03-21T10:05:00Z",
    "split_step_id": "66f01d4f1d0b5a4f7a9c3333"
    },
    {
    "id": "66f01d4f1d0b5a4f7a9c1111",
    "type": "string",
    "next_step_id": "66f01d4f1d0b5a4f7a9c2222",
    "created_at": "2024-03-21T10:00:00Z",
    "updated_at": "2024-03-21T10:05:00Z",
    "conditions": [
    {
    "id": "66f01d4f1d0b5a4f7a9c6666",
    "expression": "legal_review_approved == true",
    "step_id": "66f01d4f1d0b5a4f7a9c4444",
    "_destroy": false
    }
    ],
    "else_step_id": "66f01d4f1d0b5a4f7a9c5555"
    },
    {
    "id": "66f01d4f1d0b5a4f7a9c1111",
    "type": "string",
    "next_step_id": "66f01d4f1d0b5a4f7a9c2222",
    "created_at": "2024-03-21T10:00:00Z",
    "updated_at": "2024-03-21T10:05:00Z",
    "delay_minutes": 10,
    "delay_variable_path": "approval.delay_value",
    "delay_variable_unit": "days"
    },
    {
    "id": "66f01d4f1d0b5a4f7a9c1111",
    "type": "string",
    "next_step_id": "66f01d4f1d0b5a4f7a9c2222",
    "created_at": "2024-03-21T10:00:00Z",
    "updated_at": "2024-03-21T10:05:00Z",
    "action": "resolve",
    "terminal_state": "approved",
    "rejection_reason_template": "Falta validar {{data_subject_request.contact_information.email}}",
    "email_content_template": "Hola {{data_subject_request.contact_information.email}}, tu solicitud fue resuelta."
    },
    {
    "id": "66f01d4f1d0b5a4f7a9c1111",
    "type": "string",
    "next_step_id": "66f01d4f1d0b5a4f7a9c2222",
    "created_at": "2024-03-21T10:00:00Z",
    "updated_at": "2024-03-21T10:05:00Z",
    "to": "legal@company.com",
    "subject": "Revisión pendiente",
    "body": "Revisa la solicitud pendiente"
    },
    {
    "id": "66f01d4f1d0b5a4f7a9c1111",
    "type": "string",
    "next_step_id": "66f01d4f1d0b5a4f7a9c2222",
    "created_at": "2024-03-21T10:00:00Z",
    "updated_at": "2024-03-21T10:05:00Z",
    "title": "Confirm legal review",
    "description": "Internal reviewer handoff",
    "form_description": "Collect an internal decision before continuing.",
    "submit_button_label": "Send form",
    "recipient_type": "specific_company_user",
    "recipient_company_user_token": "cusr_1B2M2Y8AsgTpgAmY7PhCfg",
    "fields": [
    {
    "key": "decision",
    "label": "Decision",
    "type": "select",
    "required": true,
    "options": [
    "approve",
    "reject"
    ]
    }
    ]
    },
    {
    "id": "66f01d4f1d0b5a4f7a9c1111",
    "type": "string",
    "next_step_id": "66f01d4f1d0b5a4f7a9c2222",
    "created_at": "2024-03-21T10:00:00Z",
    "updated_at": "2024-03-21T10:05:00Z",
    "url": "https://api.example.com/orders/{{order.id}}",
    "method": "POST",
    "headers": [
    {
    "key": "Authorization",
    "value": "Bearer {{token}}"
    }
    ],
    "body": "{\"status\":\"approved\"}",
    "timeout_seconds": 15,
    "expected_response_schema": [
    {
    "path": "reviewer.id",
    "type": "string",
    "required": true
    }
    ],
    "response_extractors": [
    {
    "path": "result.ticket_id",
    "key": "ticket_id",
    "type": "string",
    "required": true
    }
    ]
    },
    {
    "id": "66f01d4f1d0b5a4f7a9c1111",
    "type": "string",
    "next_step_id": "66f01d4f1d0b5a4f7a9c2222",
    "created_at": "2024-03-21T10:00:00Z",
    "updated_at": "2024-03-21T10:05:00Z",
    "settings": {}
    },
    {
    "id": "66f01d4f1d0b5a4f7a9c1111",
    "type": "string",
    "next_step_id": "66f01d4f1d0b5a4f7a9c2222",
    "created_at": "2024-03-21T10:00:00Z",
    "updated_at": "2024-03-21T10:05:00Z",
    "settings": {}
    },
    {
    "id": "66f01d4f1d0b5a4f7a9c1111",
    "type": "string",
    "next_step_id": "66f01d4f1d0b5a4f7a9c2222",
    "created_at": "2024-03-21T10:00:00Z",
    "updated_at": "2024-03-21T10:05:00Z",
    "settings": {},
    "public_webhook_token": "whk_YWJjMTIzZXhhbXBsZV90b2tlbg",
    "expected_payload_schema": [
    {
    "path": "legal_review_approved",
    "type": "boolean",
    "required": true
    },
    {
    "path": "reviewer.id",
    "type": "string",
    "required": true
    }
    ]
    }
    ],
    "created_at": "2024-03-21T10:00:00Z",
    "updated_at": "2024-03-21T10:05:00Z"
    }