Iāve got data incoming from the very excellent getperspective.ai conversational form builder. Iām hoping to simply store both the āpayloadā and āheadersā objects in JSONB fields in the db, return a success message to the client, and deal with the data later. For testing, Iāve got an initial step with mock incoming data:
const headers = {
'Content-Type': 'application/json',
'X-Auth': 'KEYHERE',
'X-Idempotency-Key': '6a984a0e-1618-4e74-c856-638b3c1f9a42',
};
const payload = {
'event': 'interview.completed'
};
// Return the prepared data so subsequent steps can consume both payload and headers
return {
headers,
payload,
};
I canāt seem to use the GUI āConfigure Rowā to put the right data in the right fields. I get the simple error āInvalid valueā with the object value. Iāve even stripped the JSON object down to just one key/pair value as seen above, and it still doesnāt accept it. If anything, I would think that the Create Row might be cranky if I didnāt have values for non-null fields or something, but that isnāt at all what the errors seem to be pointing towards.
Wondering if thereās something Iām totally missing, or if itās actually a little bug?
Now Iām running into another roadblock. UI Bakeryās AI Agent has created a TS file for putting the results from catching the webhookāwhich were put in a staging tableāinto the actual table where it belongs.
Function āprocessTelnyxWebhookEventā needs to be called from my Automation after the āCreateā step puts the initial data in the staging table. How do I call this AI-Agent-generated TS file from the Automations UI?
You canāt directly import or call an AI Agentāgenerated .ts file from an Automation. The Custom App code and Automations run in separate execution environments; Automations do not have access to the appās source-file modules.
The recommended approach is to move the processing logic into an Actions Library action:
Create an action named processTelnyxWebhookEvent in Actions Library.
Recreate the TypeScript function there using JavaScript Code and/or SQL steps.
In the Automation, add an Execute Action step immediately after Create.
Select processTelnyxWebhookEvent.
Pass the newly created staging row or its ID as custom parameters, for example:
{
stagingRow: {{ steps.create.data }}
}
Inside the library action, access it as:
const stagingRow = {{ params.stagingRow }};
If the logic is only needed by this Automation, the simpler alternative is to copy the functionās body into a JavaScript Code step directly after Create. Remove TypeScript-only constructs such as interfaces and type annotations.
Actions Library actions are specifically designed for reuse in apps and Automations through Execute Action: Actions Library documentation. Automations run independently on the server in Node.js: Automations documentation.