feat: add webhookTriggerNode for receiving incoming HTTP webhooks#48
Open
DheerajShrivastav wants to merge 5 commits intowespreadjam:mainfrom
Open
feat: add webhookTriggerNode for receiving incoming HTTP webhooks#48DheerajShrivastav wants to merge 5 commits intowespreadjam:mainfrom
DheerajShrivastav wants to merge 5 commits intowespreadjam:mainfrom
Conversation
- Create webhook-trigger.ts with full node definition - Support configurable HTTP methods (GET, POST, PUT) - Implement three authentication types: none, basic auth, and custom headers - Return parsed request body, headers, method, path, query, and timestamp - Mark authentication status in output for downstream validation Co-Authored-By: Claude <noreply@anthropic.com>
- Test node metadata (type, category, capabilities) - Validate input schema constraints (path format, HTTP methods, auth types) - Test executor error handling (missing request, method mismatch) - Test authentication: none, basic auth (base64 decode), header validation - Test output schema and all fields (body, headers, method, path, query, timestamp) - Total: 28 test cases across 8 describe blocks Co-Authored-By: Claude <noreply@anthropic.com>
- Add named export for webhookTriggerNode - Export WebhookTriggerInputSchema and WebhookTriggerOutputSchema - Export TypeScript types WebhookTriggerInput and WebhookTriggerOutput Co-Authored-By: Claude <noreply@anthropic.com>
- Add webhookTriggerNode, WebhookTriggerInputSchema, WebhookTriggerOutputSchema to named exports from logic module - Add WebhookTriggerInput, WebhookTriggerOutput type exports - Import webhookTriggerNode for builtin nodes registry - Add webhookTriggerNode to builtInNodes array for auto-registration Co-Authored-By: Claude <noreply@anthropic.com>
Previously these fields were only in the input schema, so the host app had to hold onto the config separately to know what HTTP response to send back. Now the executor passes them through in the output, making the result self-contained. - Add responseCode and responseData to WebhookTriggerOutputSchema - Return input.responseCode (defaulting to 200) and input.responseData from the executor - Add 3 new tests: missing responseCode rejected, responseCode and responseData present in output, default responseCode is 200 Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #12
What
Implements
webhookTriggerNode— a configuration and validation node that processesincoming HTTP webhook payloads. The node does not spin up an HTTP server. Instead, the
host application registers the route and injects the incoming request into
context.variables.webhookRequestbefore calling the executor.Changes
packages/nodes/src/logic/webhook-trigger.ts— full node implementationpackages/nodes/src/logic/__tests__/webhook-trigger.test.ts— 31 tests across 8 suitespackages/nodes/src/logic/index.ts— exports node, schemas, and typespackages/nodes/src/index.ts— registers node in named exports andbuiltInNodesBehaviour
The executor:
webhookRequestfromcontext.variablesAuth types supported:
nonebasicAuthorization: Basic <base64>, compares username + passwordheaderOutput fields:
body,headers,method,path,query,timestamp,authenticated,responseCode,responseDataThe executor surfaces
responseCode(defaults to200) andresponseDatadirectlyin the result so the host app can send the configured HTTP response without needing
to hold onto the input config separately.
Acceptance criteria
path+methodin input schema for host app route registrationnone,basic,headerresponseCodeandresponseDatain both inputschema and executor output
WebhookTriggerInputSchema,WebhookTriggerOutputSchemaTesting