Skip to content

Test Agent Runner (Webhook)

A webhook-triggered testing workflow that accepts incoming HTTP requests with phone number, query, and channel data, then forwards this information to a sales tracking agent for processing. This workflow serves as a testing interface for validating agent functionality.

Purpose

No business context provided yet — add a context.md to enrich this documentation.

How It Works

  1. Webhook Trigger: Listens for incoming POST requests on the /sifa-test endpoint
  2. Data Extraction: Parses the request body to extract three key fields: phone number, query text, and communication channel
  3. Agent Execution: Forwards the extracted data to the SalesTrackingAgent_testing workflow and waits for completion
  4. Response: Returns the results from the agent workflow to the original caller

Workflow Diagram

graph TD
    A[Webhook<br/>POST /sifa-test] --> B[Extract Body<br/>Parse phoneNumber, query, channel]
    B --> C[Call SalesTrackingAgent_testing<br/>Execute sub-workflow]
    C --> D[Return Response]

Trigger

  • Type: Webhook (HTTP POST)
  • Path: /sifa-test
  • Method: POST
  • Response Mode: Returns output from the last executed node

Nodes Used

Node Type Node Name Purpose
Webhook Webhook Receives incoming HTTP POST requests on the /sifa-test endpoint
Set Extract Body Extracts and maps phoneNumber, query, and channel from the request body
Execute Workflow Call SalesTrackingAgent_testing Executes the SalesTrackingAgent_testing workflow with the extracted data

External Services & Credentials Required

  • Sub-workflow Access: Requires access to workflow ID SGrZ4QpudpulAtLG (SalesTrackingAgent_testing)
  • Webhook Access: No authentication required for the webhook endpoint

Environment Variables

No environment variables are directly used in this workflow. Configuration is handled through the sub-workflow execution.

Data Flow

Input (Webhook Request Body)

1
2
3
4
5
{
  "phoneNumber": "string",
  "query": "string", 
  "channel": "string"
}

Processing

  • Extracts the three fields from the request body
  • Passes them as inputs to the SalesTrackingAgent_testing workflow

Output

Returns the complete response from the SalesTrackingAgent_testing workflow execution.

Error Handling

This workflow uses basic error handling: - If the webhook receives malformed data, the Extract Body node may fail - If the sub-workflow is unavailable or fails, the Execute Workflow node will return an error - The workflow waits for sub-workflow completion before responding

Known Limitations

  • No input validation on the webhook data
  • Depends on the availability of the SalesTrackingAgent_testing workflow
  • No authentication or rate limiting on the webhook endpoint
  • Error responses may expose internal workflow details
  • SalesTrackingAgent_testing (ID: SGrZ4QpudpulAtLG) - The main agent workflow that processes the extracted data

Setup Instructions

  1. Import the Workflow

    • Copy the workflow JSON into n8n
    • The workflow will be automatically assigned a new ID
  2. Configure Dependencies

    • Ensure the SalesTrackingAgent_testing workflow (ID: SGrZ4QpudpulAtLG) exists and is accessible
    • Update the Execute Workflow node if the target workflow ID changes
  3. Activate the Workflow

    • Enable the workflow to start listening for webhook requests
    • Note the generated webhook URL for testing
  4. Test the Setup

    1
    2
    3
    4
    5
    6
    7
    curl -X POST [your-n8n-url]/webhook/sifa-test \
      -H "Content-Type: application/json" \
      -d '{
        "phoneNumber": "+1234567890",
        "query": "Test query",
        "channel": "web"
      }'
    

  5. Monitor Execution

    • Check the execution history to verify the workflow runs successfully
    • Verify that the sub-workflow receives the correct data