Workflows
Workflows are a JSON-based orchestration engine that lets you build complex automation pipelines using a visual editor. A workflow is a directed graph of nodes that can call functions, transform data, handle conditions, iterate over collections, and more. Workflows can be executed manually, triggered via API, or scheduled as periodic jobs.
UI page
You can find all workflows here
Properties
id: unique identifier of the workflowname: display name of the workflowdescription: description of the workflowtags: list of tags associated to the workflowmetadata: list of metadata associated to the workflowconfig: the root node configuration of the workflow (a JSON object describing the node graph)job: optional job scheduling configuration (see below)functions: a map of custom reusable functions defined within the workflowtest_payload: a JSON object used as input when testing the workflow from the UIorphans: disconnected nodes and edges stored by the visual editornotes: visual annotations placed on the workflow canvas in the editor
Job configuration
A workflow can optionally be scheduled as a periodic job:
enabled: is the job scheduling enabledcron: a cron expression defining when the workflow should run (e.g.,*/5 * * * * ?for every 5 seconds)config: additional job configuration
Node types
Workflows are composed of nodes. Each node has a type that determines its behavior:
workflow: a sequential execution of child nodescall: invoke a built-in or custom functionassign: assign a value to a variable in workflow memoryvalue: return a static valueif: conditional branching (if/then/else)switch: multi-path conditional branching based on value matchingforeach: iterate over an array and execute a node for each elementmap: transform each element of an arrayfilter: filter elements of an array based on a predicateflatmap: transform and flatten arraysparallel: execute multiple nodes in parallelwhile: loop while a condition is truetry: try/catch/finally error handlingerror: raise an errorwait: wait for a specified durationpause: pause workflow executionend: terminate the workflowjump: jump to another node in the workflowasync: execute a node asynchronouslybreakpoint: debugging breakpoint in the visual editor
Functions
Workflows provide a rich set of built-in functions that can be called from call nodes. These include:
- HTTP:
http_clientfor making HTTP requests - Storage:
store_get,store_set,store_del,store_keys,store_matchfor persistent key-value storage - State:
state_get,state_get_allfor accessing Otoroshi proxy state - Configuration:
config_readfor reading Otoroshi configuration - Files:
file_read,file_write,file_delfor file system operations - WASM:
wasm_callfor calling WASM functions - Workflows:
workflow_callfor calling other workflows - Events:
emit_eventfor emitting custom events - Email:
send_mailfor sending emails - System:
system_callfor executing system commands - Logging:
logfor logging messages
You can also define custom functions in the functions map of the workflow entity.
Learn more
For detailed information about node configuration, operators, expression syntax, and examples, see Otoroshi Workflows.
For information about the visual editor, debugging tools, and breakpoints, see Workflows Editor.