Skip to content

feat(quickbooks): add core webhook triggers - #6245

Open
BillLeoutsakosvl346 wants to merge 9 commits into
feat/quickbooks-integrationfrom
feat/quickbooks-08-webhook-core
Open

feat(quickbooks): add core webhook triggers#6245
BillLeoutsakosvl346 wants to merge 9 commits into
feat/quickbooks-integrationfrom
feat/quickbooks-08-webhook-core

Conversation

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor

Summary

  • add authenticated app-level QuickBooks webhook ingress with durable bounded processing
  • route events to deployed workflows for the matching QuickBooks company
  • add seven representative QuickBooks trigger options to the existing block
  • document the fixed callback and verifier-token setup using the established app-level trigger pattern

Validation

  • QuickBooks webhook route/provider/worker/target/trigger tests (15 passing)
  • Sim type-check
  • API, icon, client-boundary, and tool-registry-boundary validation
  • format, lint, documentation generation, and git diff checks
  • independent max-reasoning trigger review: no actionable findings

Live Intuit delivery remains dependent on configuring the public callback and QUICKBOOKS_WEBHOOK_VERIFIER_TOKEN; signed raw-body fixtures cover ingress locally.

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 5, 2026 10:37pm

Request Review

@cursor

cursor Bot commented Aug 4, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches webhook ingress, async job routing, and OAuth credential binding for financial data events; changes are well-tested but misconfiguration of the verifier token or realm routing could drop or misroute deliveries.

Overview
Adds QuickBooks Online webhook triggers so workflows can start from Intuit CloudEvents (29 entity-specific triggers on the QuickBooks block, with multi-select Event Types where applicable).

Ingress: New fixed callback POST /api/webhooks/quickbooks verifies intuit-signature (HMAC over the raw body via QUICKBOOKS_WEBHOOK_VERIFIER_TOKEN), validates batched envelopes (up to 1,000 events), then durably enqueues a quickbooks-webhook-ingress job before responding. The worker routes each event by company realm ID (intuitaccountid) to deployed webhooks and dispatches through the shared processor (provider ingress + queued execution, same pattern as TikTok).

Deploy & lifecycle: Trigger deploy resolves the connected OAuth company to a routing key (realm ID); credential removal deactivates bound QuickBooks webhook rows alongside Slack.

Copilot / VFS: Multi-select dropdown subblocks are validated and serialized so trigger eventTypes_* arrays are accepted in workflow edits.

Docs and integration metadata list trigger configuration outputs; .env.example documents the verifier token.

Reviewed by Cursor Bugbot for commit 6e6494d. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds authenticated QuickBooks webhook ingestion and routes company-scoped events through durable workflow dispatch.

  • Verifies Intuit signatures and validates bounded webhook envelopes before durable acceptance.
  • Adds QuickBooks trigger definitions, registry entries, deployment support, and generated integration documentation.
  • Processes all events and targets in an accepted delivery before retrying failures.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the previously reported batch-termination issue is resolved because target and lookup failures are isolated until all later events have been processed.

Important Files Changed

Filename Overview
apps/sim/app/api/webhooks/quickbooks/route.ts Adds bounded, signature-authenticated app-level webhook ingress that acknowledges deliveries only after durable enqueue.
apps/sim/background/quickbooks-webhook-ingress.ts Routes every accepted event by QuickBooks company, isolates target failures, and retries after processing the complete batch.
apps/sim/lib/webhooks/providers/quickbooks.ts Adds QuickBooks signature verification, event matching, normalization, and event-ID extraction for idempotency.
apps/sim/lib/webhooks/deploy.ts Integrates QuickBooks with the app-level trigger deployment lifecycle.
apps/sim/triggers/quickbooks/index.ts Exports the new QuickBooks event trigger catalog for registry consumption.
apps/sim/blocks/blocks/quickbooks.ts Enables trigger mode and exposes the registered QuickBooks trigger options on the existing block.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  QB[QuickBooks] --> Route[Signed webhook route]
  Route --> Validate[Verify signature and validate bounded envelope]
  Validate --> Ingress[Durable ingress job]
  Ingress --> Lookup[Find deployed targets by company realm]
  Lookup --> Dispatch[Dispatch each event to matching workflows]
  Dispatch --> Idempotency[Webhook execution idempotency]
  Idempotency --> Execute[Execute workflow]
Loading

Reviews (4): Last reviewed commit: "refactor(quickbooks): align webhook trig..." | Re-trigger Greptile

Comment thread apps/sim/background/quickbooks-webhook-ingress.ts Outdated
Comment thread apps/sim/background/quickbooks-webhook-ingress.ts
Comment thread apps/sim/app/api/webhooks/quickbooks/route.ts
Comment thread apps/sim/blocks/blocks/quickbooks.ts
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

* feat(quickbooks): complete webhook trigger matrix

* fix(quickbooks): document webhook event selectors

* fix(quickbooks): clarify webhook setup

---------

Co-authored-by: Bill Leoutsakos <billleoutsakos@Mac.localdomain>
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit afb7009. Configure here.

Comment thread apps/sim/lib/copilot/tools/server/workflow/edit-workflow/validation.ts Outdated
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

QuickBooks trigger file classification

The implementation has been kept mostly within Sim’s normal trigger patterns. I’ve classified the files as:

  • Standard: Expected files for an ordinary trigger-enabled integration.
  • Semi-standard: Established patterns used by integrations with app-level webhooks, provider authentication, or deployment routing. Slack and TikTok have comparable pieces.
  • Unique: QuickBooks-specific infrastructure that cannot currently be replaced by an existing shared Sim primitive without weakening delivery reliability.

Standard

These are the normal files expected when adding triggers to an existing integration.

Trigger definitions

  • apps/sim/triggers/quickbooks/account_events.ts — created
  • apps/sim/triggers/quickbooks/bill_events.ts — created
  • apps/sim/triggers/quickbooks/bill_payment_events.ts — created
  • apps/sim/triggers/quickbooks/budget_events.ts — created
  • apps/sim/triggers/quickbooks/class_events.ts — created
  • apps/sim/triggers/quickbooks/credit_memo_events.ts — created
  • apps/sim/triggers/quickbooks/currency_events.ts — created
  • apps/sim/triggers/quickbooks/customer_events.ts — created
  • apps/sim/triggers/quickbooks/department_events.ts — created
  • apps/sim/triggers/quickbooks/deposit_events.ts — created
  • apps/sim/triggers/quickbooks/employee_events.ts — created
  • apps/sim/triggers/quickbooks/estimate_events.ts — created
  • apps/sim/triggers/quickbooks/invoice_events.ts — created
  • apps/sim/triggers/quickbooks/item_events.ts — created
  • apps/sim/triggers/quickbooks/journal_code_events.ts — created
  • apps/sim/triggers/quickbooks/journal_entry_events.ts — created
  • apps/sim/triggers/quickbooks/payment_events.ts — created
  • apps/sim/triggers/quickbooks/payment_method_events.ts — created
  • apps/sim/triggers/quickbooks/preferences_updated.ts — created
  • apps/sim/triggers/quickbooks/purchase_events.ts — created
  • apps/sim/triggers/quickbooks/purchase_order_events.ts — created
  • apps/sim/triggers/quickbooks/refund_receipt_events.ts — created
  • apps/sim/triggers/quickbooks/sales_receipt_events.ts — created
  • apps/sim/triggers/quickbooks/tax_agency_events.ts — created
  • apps/sim/triggers/quickbooks/term_events.ts — created
  • apps/sim/triggers/quickbooks/time_activity_events.ts — created
  • apps/sim/triggers/quickbooks/transfer_events.ts — created
  • apps/sim/triggers/quickbooks/vendor_credit_events.ts — created
  • apps/sim/triggers/quickbooks/vendor_events.ts — created
  • apps/sim/triggers/quickbooks/index.ts — created
  • apps/sim/triggers/quickbooks/utils.ts — created

These contain the conventional trigger definitions, the fixed Intuit entity/action matrix, trigger matching, input formatting, and shared QuickBooks trigger options.

Block and registries

  • apps/sim/blocks/blocks/quickbooks.ts — modified
  • apps/sim/triggers/registry.ts — modified
  • apps/sim/lib/integrations/integrations.json — modified
  • apps/docs/content/docs/en/integrations/quickbooks.mdx — modified

These expose the 29 grouped trigger choices through the existing QuickBooks block, register them, and update the generated integration catalogue and documentation.

Standard trigger tests

  • apps/sim/triggers/quickbooks/quickbooks.test.ts — created

This provides table-driven behavioral coverage for all 29 choices and 101 supported entity/action combinations, including matching, formatting, event-type isolation, and Intuit void → Sim voided normalization.

Semi-standard

These files are needed because QuickBooks uses one app-level webhook endpoint rather than giving every workflow its own webhook URL.

Comparable patterns exist in integrations such as TikTok and Slack: they authenticate a shared provider callback, route an event to deployed workflows using provider-owned identity information, and then use Sim’s shared webhook dispatcher.

App-level webhook callback

  • apps/sim/app/api/webhooks/quickbooks/route.ts — created
  • apps/sim/lib/api/contracts/webhooks.ts — modified
  • scripts/check-api-validation-contracts.ts — modified

The route receives Intuit’s app-level callback, reads a bounded raw body, verifies the intuit-signature, validates the event batch, and admits it for processing. The other changes register and validate that API route.

This belongs in the trigger PR because Intuit cannot deliver events to the QuickBooks triggers without a public authenticated callback.

Test:

  • apps/sim/app/api/webhooks/quickbooks/route.test.ts — created

Webhook provider handling

  • apps/sim/lib/webhooks/providers/quickbooks.ts — created
  • apps/sim/lib/webhooks/providers/registry.ts — modified

The provider handles QuickBooks-specific signature authentication, entity/action matching, output formatting, and event-ID idempotency while still using Sim’s standard dispatcher.

TikTok and Slack have comparable provider handlers because their webhook authentication and payload formats are provider-specific.

This belongs here because these are the minimum adapters required to translate Intuit events into Sim’s standard trigger execution model.

Test:

  • apps/sim/lib/webhooks/providers/quickbooks.test.ts — created

Deployment-time company routing

  • apps/sim/lib/webhooks/deploy.ts — modified
  • apps/sim/lib/credentials/deletion.ts — modified

When a QuickBooks trigger is deployed, Sim stores the connected company’s realmId in the existing standard webhook.routingKey field. Incoming events are then routed only to workflows connected to that company.

Deleting the credential also deactivates its deployed triggers.

TikTok similarly stores an account identity in routingKey, while Slack uses installation/team identity for equivalent app-level routing.

These changes belong in this PR because correct company isolation and credential cleanup are essential parts of deploying the trigger safely.

Tests:

  • apps/sim/lib/webhooks/deploy.test.ts — modified
  • apps/sim/lib/credentials/__tests__/webhook-deactivation.test.ts — created

Provider configuration

  • apps/sim/.env.example — modified
  • apps/sim/lib/core/config/env.ts — modified

These register the server-only Intuit webhook verifier token used to authenticate callback signatures.

This is comparable to the signing secrets or verifier configuration required by other authenticated webhook providers and is directly required for the QuickBooks endpoint to reject forged deliveries.

Mothership multi-select support

  • apps/sim/lib/copilot/tools/server/workflow/edit-workflow/validation.ts — modified
  • apps/sim/lib/copilot/vfs/serializers.ts — modified

QuickBooks trigger actions use Sim’s existing multiSelect dropdown capability. Mothership previously did not serialize that flag or validate array values correctly, so it could not configure actions such as created, updated, deleted, and merged together.

These are small provider-neutral corrections to support an existing block feature—not QuickBooks-specific branches or new abstractions. They belong in this PR because without them most of the trigger matrix was impossible to configure through Mothership.

Tests:

  • apps/sim/lib/copilot/tools/server/workflow/edit-workflow/validation.test.ts — modified
  • apps/sim/lib/copilot/vfs/serializers.test.ts — modified

Unique

There is one unique runtime component: the durable QuickBooks batch-ingress job.

  • apps/sim/background/quickbooks-webhook-ingress.ts — created
  • apps/sim/lib/core/async-jobs/types.ts — modified
  • apps/sim/lib/core/async-jobs/backends/trigger-dev.ts — modified

Test:

  • apps/sim/background/quickbooks-webhook-ingress.test.ts — created

Intuit may send a single webhook request containing multiple events for multiple QuickBooks companies, while requiring the endpoint to acknowledge the delivery within roughly three seconds and recommending asynchronous processing.

The ingress job lets the callback perform only:

authenticate → validate → durably accept → acknowledge

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