Skip to content

Comments

feat: add Webhook Trigger & Response nodes — opening Node Banana to external automation#56

Open
8digit wants to merge 1 commit intoshrimbly:developfrom
8digit:feature/webhook-trigger-response
Open

feat: add Webhook Trigger & Response nodes — opening Node Banana to external automation#56
8digit wants to merge 1 commit intoshrimbly:developfrom
8digit:feature/webhook-trigger-response

Conversation

@8digit
Copy link
Contributor

@8digit 8digit commented Feb 6, 2026

Description:

Why this matters

Until now, Node Banana workflows could only be triggered manually from the canvas. This PR changes that. By adding webhook-based execution, any platform that can send an HTTP request can now trigger a Node Banana workflow — Airtable, n8n, Make, Zapier, custom scripts, or anything else.

This is a meaningful step toward making generative AI workflows more accessible. Creators who already use automation tools can now plug Node Banana into their existing pipelines without writing code or understanding the internals. Design a workflow once on the canvas, expose it via webhook, and let external systems handle the rest.

What's included

Two new nodes:

  • Webhook Trigger — Exposes a unique URL endpoint (/api/webhook/{workflow-name}) that accepts POST requests with images, text prompts, and configuration. Supports configurable image inputs (1-5), optional text input, and optional auth secret.

  • Webhook Response — Captures the final output (image or video) and sends it back to a callback URL. Accepts both image and video connections.

Async execution with callback:

Since AI generation takes 30-120+ seconds, the webhook immediately returns a jobId and executes in the background. On completion, it POSTs results to the provided callbackUrl with the generated media URL.

Generic source URL propagation:

/api/generate now preserves the original media URL from any provider (WaveSpeed, Replicate, Fal, etc.) as sourceUrl alongside base64. This keeps callback payloads small and compatible with external platforms that expect URLs.

How it works

External Platform (e.g., Airtable, n8n, Make)
  → POST /api/webhook/{workflow-name}
    { images: [...], text: "prompt", callbackUrl: "https://...", recordId: "rec123" }
  ← 200 { success: true, jobId: "job_123" }

  ... workflow executes in background (30-120s) ...

  → POST callbackUrl
    { success: true, jobId: "job_123", recordId: "rec123", imageUrl: "https://cdn.../output.jpeg" }

Files changed

  • src/types/webhook.ts — Added recordId to webhook request type, sourceUrl to generate response
  • src/app/api/webhook/[workflowId]/route.ts — Async execution with callback, media URL extraction
  • src/app/api/generate/route.ts — All providers now return sourceUrl when media was fetched from a URL
  • src/lib/executor/headlessExecutor.ts — Generate nodes store sourceUrl, webhookResponse resolves upstream media URL with fallback (image or video)
  • src/components/WorkflowCanvas.tsx — Video input handle for webhookResponse
  • src/components/ConnectionDropMenu.tsx — WebhookResponse added to video target options

Tested with

  • ✅ WaveSpeed Seedream (image-to-image)
  • ✅ Replicate Seedream (image-to-image)
  • ✅ WaveSpeed Seedance (image-to-video)
  • ✅ Airtable as external trigger and receiver
  • ✅ Callback delivers provider URLs (not base64) for both image and video

Future improvements (not in this PR)

  • Execution visibility panel in the canvas
  • Test/listen mode for webhook nodes
  • Execution history log
Screenshot 2026-02-06 at 4 21 19 PM Screenshot 2026-02-06 at 4 22 01 PM

…ution

- Add Webhook Trigger node with configurable image inputs, text, and auth secret
- Add Webhook Response node accepting both image and video connections
- Implement async execution with callback URL for external platforms
- Propagate source URLs from all providers (WaveSpeed, Replicate, Fal) through pipeline
- Keep callback payloads small by sending media URLs instead of base64
@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@l3wi
Copy link

l3wi commented Feb 18, 2026

This is great!

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.

2 participants