set_mapping
Set field mapping — Set the payload field mapping for a webhook+trigger (rename / restructure / exclude / type-cast fields with dot-notation paths).
Set the payload field mapping for a webhook+trigger (rename / restructure / exclude / type-cast fields with dot-notation paths). field_mapping is an object {"mappings":[{"source":"<dot.path in the captured payload>","target":"<dot.path in the outgoing body>","cast":"number|string|boolean|stringify" (optional)}],"excluded":["<dot.path to drop>"],"includeUnmapped":true|false}. It can only move, rename or exclude existing payload fields — static values are not supported (inject those with a pre-dispatch Code Glue snippet). The mapping runs before any pre-dispatch snippet, and with includeUnmapped:false everything unmapped is dropped, including args. When the example backing this step came from the Payload Library rather than a capture on this site, any path reaching under a site-defined container — a form's fields, post or order meta, ACF — is refused: the step pauses, names the offending paths, and asks for the event to be fired once so the real keys are known. Registered as the WordPress Ability flowsystems-webhook-actions/set-mapping, so external AI tools (Claude Code, Cursor) can call it over MCP, or over the Abilities REST route with a scoped API token.
/ Plan step shape
{ "ability": "set_mapping", "input": { "webhook_id": …, "trigger": …, "field_mapping": … } }
/ Scope & confirmation
Minimum API-token scope for external (MCP/REST) callers: full. Runs without a confirmation pause (the overall plan is still user-approved before execution starts).
/ Input fields
| Name | In | Type | Req | Description |
|---|---|---|---|---|
| webhook_id | param | integer | yes | |
| trigger | param | string | yes | |
| field_mapping | param | object | yes | Mapping definition as used by the mapping UI: `mappings` (`{source, target, cast?}`), `excluded`, `includeUnmapped`. |
/ Examples
Plan step as Build with AI proposes it
{ "id": "step_1", "ability": "set_mapping", "summary": "…", "input": { "webhook_id": 12, "trigger": "wpcf7_mail_sent", "field_mapping": { "mappings": [ { "source": "args.0.posted_data.your-email", "target": "email" } ], "excluded": [], "includeUnmapped": false } } }
/ Related