Transform an inbound webhook before calling an API Action
This recipe normalizes a provider-neutral webhook and then uses the transformed output in a GitHub Custom API Request.
Webhook Source → JSON Patch Transformation → GitHub: Custom API RequestExample input
Send a controlled request that represents a ticket to create:
{
"repository": { "owner": "acme", "name": "support" },
"ticket": { "subject": "Login fails", "details": "Customer sees a 403." },
"internal_debug": "remove before the API call"
}Confirm the exact payload location in the Trigger preview before creating the patch.
1. Normalize the payload
Add a Transformation → JSON Patch Step. Use the JSON tree to select paths from the real Step input, then test operations such as:
[
{ "op": "copy", "from": "/repository/owner", "path": "/github_owner" },
{ "op": "copy", "from": "/repository/name", "path": "/github_repository" },
{ "op": "copy", "from": "/ticket/subject", "path": "/issue_title" },
{ "op": "copy", "from": "/ticket/details", "path": "/issue_body" },
{ "op": "remove", "path": "/internal_debug" },
{ "op": "add", "path": "/normalized", "value": true }
]JSON Patch uses JSON Pointer paths. Test the patch in the builder and verify that the Result panel contains the new fields and no internal_debug field.
2. Configure the API Action
- Add GitHub → Custom API Request after the Transformation.
- Select the GitHub App account with access to the target repository.
- Choose
POST. - Set the API path to
/repos/{owner}/{repository}/issues, insertinggithub_ownerandgithub_repositoryfrom the Transformation output with the picker. - Set the request body to valid JSON using
issue_titleandissue_bodyfrom that same output.
Conceptually, the body is:
{
"title": "{{steps.normalize.issue_title}}",
"body": "{{steps.normalize.issue_body}}"
}Use the picker-generated saved paths rather than manually copying the illustrative Step ID.
3. Test the full route
Activate the Workflow and send a new test event. In Audit, verify the original Trigger payload, the Transformation output, the exact API method/path/body, and the GitHub response. Confirm that the issue appears in the intended repository.
Failure handling
Connect an error route to the Transformation when missing input paths should be recorded. Connect a separate error route to the API Action for authentication, permission, validation, and provider failures.
See Workflow transformations, GitHub integration, and Error handling.