Skip to content

Conversation

@No-Smoke
Copy link

@No-Smoke No-Smoke commented Nov 2, 2025

Description

Adds validation to detect when webhook POST bodies may not be accessed correctly in downstream nodes.

Changes

  • Added validateWebhookNodes() method to CreateWorkflowHandler
  • Validates Code and Set nodes connected to webhook nodes
  • Checks for proper body access patterns ($json.body, $input.first().json.body)
  • Returns warnings in workflow creation response
  • Non-breaking: only logs warnings, doesn't block creation

Validation Patterns

$json.body.*
$input.first().json.body.*
$input.item.json.body.*
{{ $json.body (template syntax)

Example Warning

⚠️  Webhook Validation Warnings:
   - Webhook node "webhook1" connects to Code node "processData" 
     that may not correctly access POST body. 
     Use $json.body.* or $input.first().json.body.* to access POST data.

Testing

Validated with workflows containing:

  • Webhook → Code node (with/without proper body access)
  • Webhook → Set node (with/without body references)
  • Multiple webhook nodes in single workflow

Related Issues

Addresses common webhook POST body access issues that can lead to undefined data or workflow failures.

- Add validateWebhookNodes method to check proper body access
- Warn when Code nodes don't use $json.body or $input.first().json.body
- Warn when Set nodes after POST webhooks don't reference body
- Include warnings in workflow creation response
- Non-breaking: validation only logs warnings
@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant