Saltar al contenido principal

WorkflowRun

WorkflowRun

idstring
Example: wfr_1B2M2Y8AsgTpgAmY7PhCfg
statusstring

Possible values: [running, stopped, completed, failed]

Example: completed
workflow object

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_versionintegernullable

    Versión del workflow capturada al iniciar la ejecución.

    Example: 3
    workflow_snapshot object
    tokenstringnullable
    Example: wf_1B2M2Y8AsgTpgAmY7PhCfg
    namestringnullable
    Example: Customer Onboarding
    descriptionstringnullable
    Example: Orquesta revisión legal y transición de estado
    statusstringnullable
    Example: published
    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
    Example: 66f01d4f1d0b5a4f7a9c1111
    stepsobject[]
    pending_form_submissions object[]
  • Array [
  • idstring
    Example: 66f01d4f1d0b5a4f7a9c8888
    step_idstring
    Example: 66f01d4f1d0b5a4f7a9c1111
    branch_idstringnullable
    Example: branch_1
    split_step_idstringnullable
    Example: 66f01d4f1d0b5a4f7a9c3333
    statusstring

    Possible values: [pending, submitted]

    Example: pending
    titlestring
    Example: Confirm legal review
    descriptionstringnullable
    Example: Collect an internal decision before continuing.
    submit_button_labelstring
    Example: Send form
    fields object[]
  • Array [
  • keystringrequired

    Clave estable para almacenar la respuesta del campo.

    Example: decision
    labelstringrequired

    Etiqueta visible del campo en el formulario.

    Example: Decision
    typestringrequired

    Possible values: [text, textarea, boolean, select]

    Example: select
    requiredbooleanrequired
    Example: true
    optionsstring[]

    Opciones permitidas cuando type es select.

    Example: ["approve","reject"]
  • ]
  • values object
    property name*any
    recipient_typestring

    Possible values: [specific_company_user, dsr_assignee]

    Example: specific_company_user
    recipient_company_user_tokenstringnullable
    Example: cusr_1B2M2Y8AsgTpgAmY7PhCfg
    recipient_emailstring
    Example: reviewer@company.com
    recipient_namestringnullable
    Example: Ada Lovelace
    requested_atstring<date-time>
    Example: 2024-03-21T10:00:00Z
    submitted_atstring<date-time>nullable
    Example: 2024-03-21T10:05:00Z
  • ]
  • context object
    idstring
    Example: 66f01d4f1d0b5a4f7a9c7777
    errorstringnullable
    current_step_idstringnullable
    Example: 66f01d4f1d0b5a4f7a9c2222
    run_results object[]
  • Array [
  • step_idstringrequired
    Example: 66f01d4f1d0b5a4f7a9c1111
    statusstringrequired

    Estado registrado para la ejecución del paso.

    Example: success
    messagestringnullable
    Example: DSR trigger block fired
    branch_idstringnullable
    Example: branch_1
    timestampstring<date-time>required
    Example: 2024-03-21T10:00:00Z
  • ]
  • step_events object[]
  • Array [
  • step_idstringrequired
    Example: 66f01d4f1d0b5a4f7a9c1111
    statusstringrequired

    Estado normalizado de ejecución para el paso.

    Possible values: [started, running, completed, stopped, failed]

    Example: completed
    messagestringnullable
    Example: Email sent successfully
    next_step_idstringnullable

    Paso de destino resuelto después de ejecutar el bloque.

    Example: 66f01d4f1d0b5a4f7a9c2222
    duration_msintegernullable

    Duración de ejecución del paso en milisegundos.

    Example: 153
    branch_idstringnullable
    Example: branch_1
    timestampstring<date-time>required
    Example: 2024-03-21T10:00:00Z
  • ]
  • metadata object
    property name*any
    branch_states object
    property name* WorkflowBranchState
    idstring
    Example: branch_1
    current_step_idstringnullable
    Example: 66f01d4f1d0b5a4f7a9c2222
    statusstring
    Example: waiting
    split_step_idstringnullable
    Example: 66f01d4f1d0b5a4f7a9c3333
    branch_slot_idstringnullable
    Example: branch_1
    parent_branch_idstringnullable
    Example: __root__
    entry_step_idstringnullable
    Example: 66f01d4f1d0b5a4f7a9c2222
    metadata object
    property name*any
    join_states object
    property name* WorkflowJoinState
    join_step_idstring
    Example: 66f01d4f1d0b5a4f7a9c9999
    split_step_idstring
    Example: 66f01d4f1d0b5a4f7a9c3333
    parent_branch_idstring
    Example: __root__
    expected_branch_idsstring[]
    arrived_branch_idsstring[]
    statusstring
    Example: waiting
    started_atstring<date-time>
    Example: 2024-03-21T10:00:00Z
    completed_atstring<date-time>nullable
    Example: 2024-03-21T10:00:05Z
    durationnumbernullable

    Duración en segundos.

    Example: 5.34
    created_atstring<date-time>
    Example: 2024-03-21T10:00:00Z
    updated_atstring<date-time>
    Example: 2024-03-21T10:00:05Z
    WorkflowRun
    {
    "id": "wfr_1B2M2Y8AsgTpgAmY7PhCfg",
    "status": "completed",
    "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"
    },
    "workflow_version": 3,
    "workflow_snapshot": {
    "token": "wf_1B2M2Y8AsgTpgAmY7PhCfg",
    "name": "Customer Onboarding",
    "description": "Orquesta revisión legal y transición de estado",
    "status": "published",
    "settings": {
    "failure_alerts": {
    "enabled": false
    }
    },
    "starting_step_id": "66f01d4f1d0b5a4f7a9c1111",
    "steps": [
    {}
    ]
    },
    "pending_form_submissions": [
    {
    "id": "66f01d4f1d0b5a4f7a9c8888",
    "step_id": "66f01d4f1d0b5a4f7a9c1111",
    "branch_id": "branch_1",
    "split_step_id": "66f01d4f1d0b5a4f7a9c3333",
    "status": "pending",
    "title": "Confirm legal review",
    "description": "Collect an internal decision before continuing.",
    "submit_button_label": "Send form",
    "fields": [
    {
    "key": "decision",
    "label": "Decision",
    "type": "select",
    "required": true,
    "options": [
    "approve",
    "reject"
    ]
    }
    ],
    "values": {},
    "recipient_type": "specific_company_user",
    "recipient_company_user_token": "cusr_1B2M2Y8AsgTpgAmY7PhCfg",
    "recipient_email": "reviewer@company.com",
    "recipient_name": "Ada Lovelace",
    "requested_at": "2024-03-21T10:00:00Z",
    "submitted_at": "2024-03-21T10:05:00Z"
    }
    ],
    "context": {
    "id": "66f01d4f1d0b5a4f7a9c7777",
    "error": "string",
    "current_step_id": "66f01d4f1d0b5a4f7a9c2222",
    "run_results": [
    {
    "step_id": "66f01d4f1d0b5a4f7a9c1111",
    "status": "success",
    "message": "DSR trigger block fired",
    "branch_id": "branch_1",
    "timestamp": "2024-03-21T10:00:00Z"
    }
    ],
    "step_events": [
    {
    "step_id": "66f01d4f1d0b5a4f7a9c1111",
    "status": "completed",
    "message": "Email sent successfully",
    "next_step_id": "66f01d4f1d0b5a4f7a9c2222",
    "duration_ms": 153,
    "branch_id": "branch_1",
    "timestamp": "2024-03-21T10:00:00Z"
    }
    ],
    "metadata": {},
    "branch_states": {},
    "join_states": {}
    },
    "started_at": "2024-03-21T10:00:00Z",
    "completed_at": "2024-03-21T10:00:05Z",
    "duration": 5.34,
    "created_at": "2024-03-21T10:00:00Z",
    "updated_at": "2024-03-21T10:00:05Z"
    }