Skip to content

feat: add webhookTriggerNode for receiving incoming HTTP webhooks#48

Open
DheerajShrivastav wants to merge 5 commits intowespreadjam:mainfrom
DheerajShrivastav:feat/webhook-integration
Open

feat: add webhookTriggerNode for receiving incoming HTTP webhooks#48
DheerajShrivastav wants to merge 5 commits intowespreadjam:mainfrom
DheerajShrivastav:feat/webhook-integration

Conversation

@DheerajShrivastav
Copy link
Contributor

Closes #12

What

Implements webhookTriggerNode — a configuration and validation node that processes
incoming 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.webhookRequest before calling the executor.

Changes

  • packages/nodes/src/logic/webhook-trigger.ts — full node implementation
  • packages/nodes/src/logic/__tests__/webhook-trigger.test.ts — 31 tests across 8 suites
  • packages/nodes/src/logic/index.ts — exports node, schemas, and types
  • packages/nodes/src/index.ts — registers node in named exports and builtInNodes

Behaviour

The executor:

  1. Reads webhookRequest from context.variables
  2. Validates the HTTP method matches the configured method
  3. Runs the configured auth check
  4. Returns the processed payload as structured output

Auth types supported:

Type How it works
none No check, always passes
basic Decodes Authorization: Basic <base64>, compares username + password
header Checks each configured key/value pair against incoming headers (case-insensitive)

Output fields: body, headers, method, path, query, timestamp,
authenticated, responseCode, responseData

The executor surfaces responseCode (defaults to 200) and responseData directly
in the result so the host app can send the configured HTTP response without needing
to hold onto the input config separately.

Acceptance criteria

  • HTTP endpoint creation — path + method in input schema for host app route registration
  • Multiple auth methods — none, basic, header
  • Custom response configuration — responseCode and responseData in both input
    schema and executor output
  • Zod schemas for input/output — WebhookTriggerInputSchema, WebhookTriggerOutputSchema
  • Unit tests

Testing

pnpm build                          # passes
pnpm --filter @jam-nodes/nodes test # 128 tests total, 31 new — 0 failures
npx tsx test-webhook.ts             # 11 manual tests — 0 failures

DheerajShrivastav and others added 5 commits March 5, 2026 00:03
- 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>
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.

[Node] webhookTriggerNode - Receive incoming webhooks

1 participant