Triggers start a workflow automatically: on an inbound message, a WhatsApp event, a project event, or an API call.
A trigger map has trigger_type ("inbound_message", "api_call",
"whatsapp_event", "project_event"), active, and type specific
fields: phone_number_id, event, event_name, property_key,
operator and property_value.
Summary
Functions
Creates a trigger.
Deletes a trigger.
Lists a workflow's triggers.
Atomically replaces every trigger of a workflow. If any trigger is invalid, nothing changes.
Updates a trigger. Only active can be changed.
Types
@type result() :: {:ok, map() | nil} | {:error, KapsoEx.Error.t()}
Functions
@spec create(KapsoEx.Client.t(), String.t(), map() | keyword()) :: result()
Creates a trigger.
Triggers.create(client, workflow_id, trigger_type: "inbound_message", phone_number_id: pnid)
@spec delete(KapsoEx.Client.t(), String.t()) :: result()
Deletes a trigger.
@spec list(KapsoEx.Client.t(), String.t()) :: result()
Lists a workflow's triggers.
@spec replace(KapsoEx.Client.t(), String.t(), [map()]) :: result()
Atomically replaces every trigger of a workflow. If any trigger is invalid, nothing changes.
@spec update(KapsoEx.Client.t(), String.t(), map() | keyword()) :: result()
Updates a trigger. Only active can be changed.