Skip to content

[Weekly Report] Test Suite

This workflow provides a testing interface for weekly report generation functionality. It accepts test requests via webhook, processes them through a handler workflow, and returns structured responses for validation and debugging purposes.

Purpose

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

How It Works

  1. Receive Test Request: A webhook endpoint accepts POST requests containing test parameters including query text, test ID, and test name
  2. Map Input Data: Extracts and structures the incoming test parameters from the request body
  3. Execute Handler: Calls an external workflow (ID: SlShcSkVHkkJ54wK) to process the test query and generate a summary
  4. Prepare Response: Formats the results into a structured response including test metadata and summary information
  5. Return Results: Sends the formatted response back to the caller with test results and summary data

Workflow Diagram

graph TD
    A[Test Webhook] --> B[Map Input]
    B --> C[Call Handler]
    C --> D[Prepare Response]
    D --> E[Respond to Webhook]

Trigger

Webhook Trigger: POST endpoint at /test-weekly-report-prod - Webhook ID: test-wr-prod - Expects JSON payload with query, testId, and testName fields

Nodes Used

Node Type Node Name Purpose
Webhook Test Webhook Receives incoming test requests via HTTP POST
Set Map Input Extracts and maps query, testId, and testName from request body
Execute Workflow Call Handler Invokes external workflow (SlShcSkVHkkJ54wK) for processing
Code Prepare Response Formats response with test metadata and summary results
Respond to Webhook Respond to Webhook Returns structured JSON response to caller

External Services & Credentials Required

  • Internal Workflow Dependency: Requires access to workflow ID SlShcSkVHkkJ54wK
  • No external API credentials required

Environment Variables

No environment variables are explicitly used in this workflow.

Data Flow

Input (Webhook Body):

1
2
3
4
5
{
  "query": "string - The test query to process",
  "testId": "number - Unique identifier for the test",
  "testName": "string - Descriptive name for the test"
}

Output (Response):

1
2
3
4
5
6
7
{
  "testId": "number - Echo of input test ID",
  "testName": "string - Echo of input test name", 
  "query": "string - Echo of input query",
  "summary": "string - Generated summary or error message",
  "summaryLength": "number - Character count of summary"
}

Error Handling

  • Handler Workflow Errors: The "Call Handler" node is configured with onError: continueRegularOutput, allowing the workflow to continue even if the handler workflow fails
  • Fallback Response: If the handler workflow fails, the response will include error information in the summary field
  • Default Values: Missing input fields default to safe values (empty strings, 0 for numbers, "Unknown" for test names)

Known Limitations

  • Workflow is currently inactive (active: false)
  • Depends on external workflow availability (ID: SlShcSkVHkkJ54wK)
  • No input validation on webhook payload structure
  • Error details from handler workflow may be limited
  • Handler Workflow (ID: SlShcSkVHkkJ54wK) - The main processing workflow that this test suite validates

Setup Instructions

  1. Import Workflow: Import the JSON configuration into your n8n instance
  2. Verify Handler Workflow: Ensure workflow SlShcSkVHkkJ54wK exists and is accessible
  3. Activate Webhook: Enable the workflow to activate the webhook endpoint
  4. Test Connection: Send a POST request to /test-weekly-report-prod with sample data:
    1
    2
    3
    4
    5
    {
      "query": "test query",
      "testId": 1,
      "testName": "Sample Test"
    }
    
  5. Verify Response: Confirm you receive a structured JSON response with test results
  6. Configure Access: Ensure the workflow has appropriate permissions to execute the handler workflow