Skip to main content
POST
/
v1
/
api
/
add_workflow_step
curl -X POST https://api.hookpulse.io/v1/api/add_workflow_step/ \
  -H "x-hookpulse-api-key: {{x-hookpulse-api-key}}" \
  -H "x-brand-uuid: {{x-brand-uuid}}" \
  -H "Content-Type: application/json" \
  -d '{
    "index": {{index}},
    "workflow_uuid": "{{workflow_uuid}}",
    "webhook_name": "{{webhook_name}}",
    "webhook_description": "{{webhook_description}}",
    "method": "{{method}}",
    "path": "{{path}}",
    "domain_uuid": "{{domain_uuid}}",
    "human_approval_required": {{human_approval_required}},
    "step_identifier": "{{step_identifier}}",
    "on_success_next_step_identifier": "{{on_success_next_step_identifier}}",
    "on_fail_next_step_identifier": "{{on_fail_next_step_identifier}}",
    "delay_to_next_step": {{delay_to_next_step}},
    "execution_condition": {
      "operator": "{{operator}}",
      "field": "{{field}}",
      "value": "{{value}}"
    },
    "retry_delay": {{retry_delay}},
    "retry_backoff_mode": "{{retry_backoff_mode}}",
    "max_retries": {{max_retries}},
    "request_timeout_in_milliseconds": {{request_timeout_in_milliseconds}},
    "request_body_json": {},
    "headers_json": {},
    "query_params_json": {}
  }'
{
  "success": true,
  "details": "Workflow webhook added successfully"
}
Add a webhook step to an existing workflow template. This endpoint allows you to configure individual steps within a workflow, including execution order, conditions, retry logic, and template variables.

Base URL

All API requests should be made to:
https://api.hookpulse.io

Example request

curl -X POST https://api.hookpulse.io/v1/api/add_workflow_step/ \
  -H "x-hookpulse-api-key: {{x-hookpulse-api-key}}" \
  -H "x-brand-uuid: {{x-brand-uuid}}" \
  -H "Content-Type: application/json" \
  -d '{
    "index": {{index}},
    "workflow_uuid": "{{workflow_uuid}}",
    "webhook_name": "{{webhook_name}}",
    "webhook_description": "{{webhook_description}}",
    "method": "{{method}}",
    "path": "{{path}}",
    "domain_uuid": "{{domain_uuid}}",
    "human_approval_required": {{human_approval_required}},
    "step_identifier": "{{step_identifier}}",
    "on_success_next_step_identifier": "{{on_success_next_step_identifier}}",
    "on_fail_next_step_identifier": "{{on_fail_next_step_identifier}}",
    "delay_to_next_step": {{delay_to_next_step}},
    "execution_condition": {
      "operator": "{{operator}}",
      "field": "{{field}}",
      "value": "{{value}}"
    },
    "retry_delay": {{retry_delay}},
    "retry_backoff_mode": "{{retry_backoff_mode}}",
    "max_retries": {{max_retries}},
    "request_timeout_in_milliseconds": {{request_timeout_in_milliseconds}},
    "request_body_json": {},
    "headers_json": {},
    "query_params_json": {}
  }'

Request body

FieldTypeRequiredDescription
indexintegerYesPriority index for FIFO execution order (0 is first step)
workflow_uuidstringYesUUID of the workflow template to add the step to
webhook_namestringYesName of the webhook step
webhook_descriptionstringYesDescription of the webhook step
methodstringYesHTTP method. Allowed values: "GET", "POST", "PUT", "DELETE", "PATCH"
pathstringYesURL path for the webhook (supports template variables)
domain_uuidstringYesUUID of the domain associated with this webhook step
human_approval_requiredbooleanYesWhether this step requires human approval before execution
step_identifierstringYesUnique identifier (slug) for this step
on_success_next_step_identifierstringYesStep identifier to execute next on success
on_fail_next_step_identifierstringYesStep identifier to execute next on failure
delay_to_next_stepintegerYesDelay in seconds before executing the next step
execution_conditionobjectNoCondition that must be met for this step to execute
execution_condition.operatorstringNoComparison operator: "eq", "ne", "lt", "gt", "lte", "gte", "in", "contains"
execution_condition.fieldstringNoField path to evaluate
execution_condition.valuestringNoValue to compare against
retry_delayintegerYesDelay in seconds between retry attempts (default: 10)
retry_backoff_modestringYesRetry backoff strategy: "linear" (default) or "exponential"
max_retriesintegerYesMaximum number of retry attempts (default: 5)
request_timeout_in_millisecondsintegerYesRequest timeout in milliseconds (default: 5000)
request_body_jsonobjectYesRequest body as JSON object (supports template variables)
headers_jsonobjectYesHTTP headers as JSON object (supports template variables)
query_params_jsonobjectYesQuery parameters as JSON object (supports template variables)

Execution Order (Index)

The index field defines the priority and execution order for FIFO (First-In-First-Out) workflows:
  • Lower index = Higher priority: Steps with lower index values execute first
  • Index 0: First step to execute
  • Sequential execution: In FIFO mode, steps execute in order based on their index
  • Concurrent mode: Index may still be used for reference, but steps execute in parallel

Execution Conditions

The execution_condition field allows you to control when a step executes based on field values:

Supported Operators

OperatorDescriptionExample
eqEqual toamount eq 100
neNot equal tostatus ne "cancelled"
ltLess thanquantity lt 10
gtGreater thanprice gt 1000
lteLess than or equal toage lte 18
gteGreater than or equal toscore gte 80
inValue in arraystatus in ["active", "pending"]
containsString contains substringemail contains "@example.com"

Example Execution Condition

{
  "execution_condition": {
    "operator": "gt",
    "field": "amount",
    "value": "1000"
  }
}
This condition ensures the step only executes if amount > 1000.

Template Variables

Workflow steps support dynamic variable substitution in request_body_json, headers_json, query_params_json, and path:

System Secret Variables

Access secrets from the System Secret Vault:
{{ #key }}
Example:
{
  "headers_json": {
    "Authorization": "Bearer {{ #api_key }}"
  }
}

Step Response Variables

Access data from previous workflow steps (FIFO mode only):
{{ step.response.variable }}
Example:
{
  "request_body_json": {
    "payment_id": "{{ step.response.payment_id }}",
    "status": "{{ step.response.status }}"
  }
}

Initial Variables

Access variables from initial workflow input (FIFO mode only):
{{ initial.variable }}
Example:
{
  "request_body_json": {
    "user_id": "{{ initial.user_id }}",
    "order_total": "{{ initial.total }}"
  }
}
Note: In concurrent mode, only system secret variables ({{ #key }}) are available. Step response and initial variables are not supported in concurrent execution.

Step Flow Control

Success and Failure Paths

  • on_success_next_step_identifier: Defines which step to execute next when this step succeeds
  • on_fail_next_step_identifier: Defines which step to execute next when this step fails
  • delay_to_next_step: Adds a delay (in seconds) before executing the next step

Human Approval

When human_approval_required is true:
  • The workflow pauses at this step
  • A human must approve or deny the step before execution continues
  • This provides manual intervention capabilities for critical operations

Example response

{
  "success": true,
  "details": "Workflow webhook added successfully"
}

Response fields

FieldTypeDescription
successbooleanIndicates if the request was successful
detailsstringSuccess message

Authorizations

x-hookpulse-api-key
string
header
required

API key for authentication. Get this from your dashboard by selecting a brand and going to API Keys section.

x-brand-uuid
string
header
required

Brand UUID for authentication. Get this from your dashboard after adding a brand - it will be displayed in the UI.

Body

application/json

Workflow step configuration

index
integer
required

Priority index for FIFO execution order (0 is first)

workflow_uuid
string
required

UUID of the workflow template to add the step to

webhook_name
string
required

Name of the webhook step

webhook_description
string
required

Description of the webhook step

method
enum<string>
required

HTTP method for the webhook call

Available options:
GET,
POST,
PUT,
DELETE,
PATCH
path
string
required

URL path for the webhook (supports template variables)

domain_uuid
string
required

UUID of the domain associated with this webhook step

human_approval_required
boolean
required

Whether this step requires human approval before execution

step_identifier
string
required

Unique identifier (slug) for this step

on_success_next_step_identifier
string
required

Step identifier to execute next on success

on_fail_next_step_identifier
string
required

Step identifier to execute next on failure

delay_to_next_step
integer
required

Delay in seconds before executing the next step

retry_delay
integer
required

Delay in seconds between retry attempts (default: 10)

retry_backoff_mode
enum<string>
required

Retry backoff strategy (default: linear)

Available options:
linear,
exponential
max_retries
integer
required

Maximum number of retry attempts (default: 5)

request_timeout_in_milliseconds
integer
required

Request timeout in milliseconds (default: 5000)

request_body_json
object
required

Request body as JSON object (supports template variables: {{ #key }}, {{ step.response.key }}, {{ initial.key }})

headers_json
object
required

HTTP headers as JSON object (supports template variables)

query_params_json
object
required

Query parameters as JSON object (supports template variables)

execution_condition
object

Condition that must be met for this step to execute

Response

Workflow step added successfully

success
boolean

Indicates if the request was successful

details
string

Success message