Loading...
Loading...
Execute Code Engine functions from apps with domo.post and strict packagesMapping input/output contracts.
npx skill4agent add stahura/domo-ai-vibe-rules cap-apps-code-enginedomo.post('/domo/codeengine/v2/packages/{alias}', params)Legacy endpoint-first guidance has been archived to.archive/legacy-rules/domo-code-engine.md
domo.postnpm install ryuu.jsimport domo from 'ryuu.js';
const response = await domo.post('/domo/codeengine/v2/packages/calculateTax', {
amount: 1000,
state: 'CA'
});// First integration pass: inspect exact response shape for this function
console.log('Code Engine response:', response);
const body = response?.body ?? response?.data ?? response;
// Handle common output shapes
const output =
body?.output ??
body?.result ??
body?.value ??
body;
if (typeof output === 'number') {
// numeric output
} else if (typeof output === 'string') {
// string output
} else if (output && typeof output === 'object') {
// structured object output
} else {
throw new Error('Code Engine returned no usable output');
}packagesMappingspackagesMapping{
"packagesMapping": [
{
"name": "myPackage",
"alias": "myFunction",
"packageId": "00000000-0000-0000-0000-000000000000",
"version": "1.0.0",
"functionName": "myFunction",
"parameters": [
{
"name": "param1",
"displayName": "param1",
"type": "decimal",
"value": null,
"nullable": false,
"isList": false,
"children": [],
"entitySubType": null,
"alias": "param1"
}
],
"output": {
"name": "result",
"displayName": "result",
"type": "number",
"value": null,
"nullable": false,
"isList": false,
"children": [],
"entitySubType": null,
"alias": "result"
}
}
]
}nullableasync function executeFunction(alias: string, payload: Record<string, unknown>) {
try {
const response = await domo.post(`/domo/codeengine/v2/packages/${alias}`, payload);
console.log('Code Engine response:', response);
return response?.body ?? response?.data ?? response;
} catch (error) {
console.error(`Code Engine call failed for alias ${alias}`, error);
throw error;
}
}.cursor/rules/04-toolkit.mdc.cursor/rules/06-manifest.mdc.cursor/rules/09-gotchas.mdcdomo.post('/domo/codeengine/v2/packages/{alias}', params)packagesMappingpackageMappingpackagesMapping.parametersoutputnamedisplayNametypevaluenullableisListchildrenentitySubTypealiasbodydata