Core Concepts
Workflow

Workflow

Overview

A Workflow is a sequence of steps that define an automation process. Each step is an action that can be executed by the platform. Workflows can be created and managed through the platform's API.

Request Body Structure

The request body is a JSON object with the following top-level fields:

FieldTypeDescription
namestringThe name of the workflow
stepsarray of objectsDefines the actions in the workflow
wiresarray of objectsDefines connections between steps
workflow_inputobjectDefines the input for the workflow
workflow_outputobjectDefines the output for the workflow

Detailed Field Descriptions

name (string, required)

The name of the workflow.

steps (array of objects, required)

An array of step objects that define the actions in the workflow. Each step object has the following structure:

{
  "conditions": array,
  "l2_data": object,
  "name": string,
  "request_data": object,
  "type": string
}

Step Object Fields

  • conditions (array of objects): Conditions that must be met for the step to execute.

    • data_path (string): The path to the data being evaluated.
    • value (any): The value to compare against.
  • l2_data (object): Data specific to L2 actions.

    • action (string): The action to perform.
    • input_data (object): Input data for the action. Properties can be of any type.
    • module (string): The module to use.
    • provider (string): The provider of the action.
  • name (string): The name of the step.

  • request_data (object): Data for making HTTP requests.

    • body (any): The request body.
    • headers (object): Key-value pairs for request headers.
    • method (string): The HTTP method.
    • path_params (object): Key-value pairs for path parameters.
    • query_params (object): Key-value pairs for query parameters.
    • url (string): The URL for the request.
  • type (string): The type of the step.

wires (array of objects, required)

An array of wire objects that define connections between steps. Each wire object has the following structure:

{
  "source_data_path": string,
  "source_name": string,
  "target_data_path": string,
  "target_name": string
}

Wire Object Fields

  • source_data_path (string): The data path in the source step.
  • source_name (string): The name of the source step.
  • target_data_path (string): The data path in the target step.
  • target_name (string): The name of the target step.

workflow_input (object, required)

Defines the input for the workflow.

{
  "input_schema": object,
  "name": string
}
  • input_schema (object): Defines the schema for the input. Properties can be of any type.
  • name (string): The name of the input.

workflow_output (object, required)

Defines the output for the workflow.

{
  "name": string
}
  • name (string): The name of the output.

Example

Here's a minimal example of a workflow request:

{
  "name": "slack_message",
  "workflow_input": {
    "name": "input",
    "input_schema": {
        "type": "object",
        "properties": {
            "message": {
              "type": "string"
            },
            "send_hello": {
              "type": "boolean"
            }
        },
        "required": ["message", "send_hello"]
    }
  },
  "workflow_output": {
    "name": "output"
  },
  "steps": [
    {
      "name": "slack_1",
      "type": "l2",
      "l2_data": {
        "provider": "slack",
        "module": "bot",
        "action": "send_message",
        "input_data": { "channel": "test"}
      }
    },
    {
      "name": "slack_2",
      "type": "l2",
      "l2_data": {
        "provider": "slack",
        "module": "bot",
        "action": "send_message",
        "input_data": { "channel": "test", "message": "Hello from slack_2"}
      },
      "conditions": [
        {"data_path": "send_hello", "value": true}
      ]
    },
    {
      "name": "dummy",
      "type": "l2",
      "l2_data": {
        "provider": "pontus",
        "module": "dummy",
        "action": "dummy_task",
        "input_data": { "test": { "Count": 1 } }
      },
      "conditions": []
    }
  ],
  "wires": [
    {
      "source_name": "input",
      "source_data_path": "message",
      "target_name": "slack_1",
      "target_data_path": "message"
    },
    {
      "source_name": "input",
      "source_data_path": "send_hello",
      "target_name": "slack_2",
      "target_data_path": "send_hello"
    },
    {
      "source_name": "slack_1",
      "target_name": "slack_2"
    },
    {
      "source_name": "slack_2",
      "target_name": "dummy"
    }
  ]
}