Workflows: automated WhatsApp conversations built from nodes and edges.
Executions are in KapsoEx.Workflows.Executions and triggers in
KapsoEx.Workflows.Triggers.
Summary
Functions
Creates a draft workflow. Attributes: name (required), slug,
description, definition (%{nodes: [...], edges: [...]}).
Gets workflow metadata, status and execution stats (without the definition).
Gets the workflow with its editor definition (nodes and edges).
Gets the system variables and the variables discovered from past executions.
Lists workflows, newest first.
Updates a workflow. Attributes: name, slug, description, status
("draft", "active", "archived"), message_debounce_seconds,
inbound_message_read_mode, definition, and lock_version for
optimistic locking.
Types
@type result() :: {:ok, map()} | {:error, KapsoEx.Error.t()}
Functions
@spec create(KapsoEx.Client.t(), map() | keyword()) :: result()
Creates a draft workflow. Attributes: name (required), slug,
description, definition (%{nodes: [...], edges: [...]}).
@spec get(KapsoEx.Client.t(), String.t()) :: result()
Gets workflow metadata, status and execution stats (without the definition).
@spec get_definition(KapsoEx.Client.t(), String.t()) :: result()
Gets the workflow with its editor definition (nodes and edges).
@spec get_variables(KapsoEx.Client.t(), String.t()) :: result()
Gets the system variables and the variables discovered from past executions.
@spec list(KapsoEx.Client.t(), map() | keyword()) :: result()
Lists workflows, newest first.
Params: status, name_contains, created_after, created_before.
@spec update(KapsoEx.Client.t(), String.t(), map() | keyword()) :: result()
Updates a workflow. Attributes: name, slug, description, status
("draft", "active", "archived"), message_debounce_seconds,
inbound_message_read_mode, definition, and lock_version for
optimistic locking.
Workflows.update(client, workflow_id, status: "active")