feat(capi): add meta capi event dialog, action sources and test events - #1084
Merged
Conversation
viethung0o0
marked this pull request as ready for review
September 3, 2026 17:32
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.
Summary
business_messagingby default, oremail,phone_call,chat,physical_store,system_generated,other), an event from the catalog that source allows (Meta's 14 Business Messaging events, or the 17 Pixel standard events plus a custom name for non-messaging sources), optional content type and content IDs, value / currency (required forPurchase,{{variable}}templates accepted), and Content Category / Content Name under an Advanced section. The step shows a compact summary in the node and lives at the top level of the action menu.user_data), keeps the messaging identity (page-scoped id / IGSID /wa_id+ctwa_clid) forbusiness_messaging, and forwardscontent_type/content_idsto Meta. WhatsApp per-day dedup now applies only to business-messaging events; every other channel / action source gets a distinctevent_idper fire.{{variable}}that resolves to a value Meta cannot accept is recorded in the workspace Error Log (with the resolved values) instead of only in worker logs; the step takes its error branch.test_event_code(while set, every event of that integration is routed to Events Manager → Test events and not counted in reports) and Send test event, which queues a samplePurchasethrough the real pipeline. A test event is refused without a saved code, the worker re-checks the code right before sending, and WhatsApp tests only use click-to-WhatsApp-attributed contacts.Changes
packages/utils/src/meta-capi.ts: action-source values/schema, both event catalogs,metaCapiActionSourcePolicy(identity strategy + catalog + custom-name rule), shared defaults.packages/flow-config:metaCapiEventFieldsSchemashared by step, trigger action, dialog and business input;withMetaCapiEventRefinements(Purchase needs value+currency; event must belong to the action source's catalog).packages/database:MetaCapiEvent.actionSource/contentType/contentIds(+ checks),capiTestEventCodeon the three integration tables,manualTestevent source,contactInboxRepository.findMostRecentByInbox,updateCapiTestEventCodeper repository, two migrations with snapshots.packages/business/meta-conversions:enqueueEventInputwith content fields,channel-policy.ts(per-channelctwa_clid/ per-day dedup rules),saveCapiTestEventCode,enqueueTestEvent,provisionDatasetNow, adapter contract extended for all three channels.integrations/meta-conversions: discriminated business-messaging vs non-messaging identity,content_type/content_idsincustom_data, optionaltest_event_codeon the request.apps/worker: policy-driven identity in the send handler,test_event_codeforwarding with a pre-send re-read for manual tests, Error Log reporting for invalid resolved templates (flow step + trigger executor via oneenqueueCapiEvent), channel gate via the shared channel schema.apps/builder:MetaCapiEventDialog/MetaCapiEventFields(one field set for step and trigger), event catalog options, labels and summary helpers,CapiTestEventCard+ two channel-generic server actions, CAPI tab states (awaitingScope/missingPermission),FormFieldWrappergainsdescriptionHrefandhideMessage, top-level action menu entry, i18n keys in all 20 locales,docs/ads-conversion-tracking.mdupdated.Test plan
pnpm lint(ultracite + i18n key parity across all 20 locales)check-typesfor utils, flow-config, database, business, ui, integration-meta-conversions, worker, builderMetaCapiEventsentforbusiness_messagingandemailsources; Test events card → event visible in Events Manager → Test events with_valueToSum;content_category/content_namerecorded under Sampled activitiesDeploy
Apply migrations
20260903042613_add_meta_capi_event_action_source_contentand20260903135251_add_capi_test_event_codebefore rolling out the worker and builder (both add nullable / defaulted columns only). Deploy the worker before (or together with) the builder somanualTestevents andtest_event_codeare handled.