Trigger a Custom Function with Rules Automation

Use Rules Automation to run a published General Custom Function when an inbound webhook arrives or on a fixed schedule.

Publishing a Custom Function does not execute it by itself. The function runs only when it is linked as the action on an active Rules Automation rule.

  • Rules Automation is enabled for your org, and you have the Manage Rules scope.
  • You can access the Custom Functions library to create (and publish) a General function.
  • You have a single-tenant Sombra selected for the Custom Function (Sombra is configured on the function, not on the rule).
  • For webhook triggers: your system can send an authenticated POST request with HMAC signature headers.
  1. Create a General Custom Function in the Custom Functions library and publish it.
  2. Create a Rules Automation rule and set the action to your published Custom Function.
  3. Activate the rule. Webhook ingestion only resolves Active rules.
  4. When the trigger fires, Transcend queues the run and then executes the active version of the function on your Sombra.
  5. For webhook triggers, a `200` response means the webhook was accepted for asynchronous processing (not that the function has finished).

Rules Automation custom function actions use a General custom function. In the function editor, implement `export default` and configure environment variables in the function's Environment Variables tab.

export default async function handler({\n  environment,\n  payload,\n  sdk,\n  kv,\n}: CustomFunction.GeneralArgument): Promise<void> {\n  // Your automation logic\n}

In the Admin Dashboard, go to Developer Tools → Rules Automation → Rules, and create (or edit) a rule. Fill in the rule title and owners, then configure the trigger and the action.

Configure HMAC authentication in the rule wizard, then save the rule to reveal the webhook URL ending in `/api/v1/webhooks/<webhook-id>`.

For schedule triggers, set `Starts` (at least 10 minutes in the future) and `Repeat` (Daily, Weekly, Monthly, Yearly, or a custom interval). The schedule runs at the times you configure; there is no inbound webhook URL.

In the action configuration, select your published General Custom Function. Do not paste code into the rule; code and environment variables live in the function editor.

For webhook rules, send a signed POST request. Then check the rule's History (for execution outcomes) and the Custom Function's runs/logs (for console output).

  • 200: accepted for async processing (function runs after this response).
  • 401: HMAC signature verification failed.
  • 404: webhook ID not found or the rule is not Active.
  • 429: rate limit exceeded (check the Retry-After header).

Rules Automation overview: https://docs.transcend.io/docs/articles/rules-automation/introduction-to-rules-automation

Webhook guide (HMAC setup): https://docs.transcend.io/docs/articles/rules-automation/webhook-user-guide

Custom Functions runtime + arguments: https://docs.transcend.io/docs/articles/custom-functions-overview/introduction-to-custom-functions