RequestPolicyApprovalExecutionReceipt
Tessra
Build your own action
Keys must match ^[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*$ (single dot). Use user catalog + param schema + param_schema execution mode.
Sequence
- UPSERT_ACTION_DEFINITION — register + enable
- UPSERT_ORG_POLICY_RULE — ordered thresholds
- CONFIGURE_EXECUTOR — webhook URL + auth JSON
- REQUEST_ACTION or SIMULATE_ACTION, then GET_ACTION_STATUS
First-run without custom keys lives in Quickstart.
Register the action (UPSERT_ACTION_DEFINITION)
CALL APP.UPSERT_ACTION_DEFINITION(
'customer.credit_issue',
'Customer credit',
'Goodwill or recovery credit',
'user',
PARSE_JSON('{"type":"object","properties":{"customer_id":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"}},"required":["amount","currency"]}'),
NULL,
TRUE
);Rules
- SIMULATE_ACTION evaluates policy without a durable enforce intent.
- Approvals never run inside SQL—only configured channels.
Policy + request
CALL APP.UPSERT_ORG_POLICY_RULE(
'customer.credit_issue','prod',1,'<=',100,'ALLOW',TRUE);
CALL APP.UPSERT_ORG_POLICY_RULE(
'customer.credit_issue','prod',2,'<=',500,'REQUIRE_APPROVAL',TRUE);
CALL APP.UPSERT_ORG_POLICY_RULE(
'customer.credit_issue','prod',3,'>',500,'DENY',TRUE);
CALL APP.REQUEST_ACTION(
'customer.credit_issue',
PARSE_JSON('{"customer_id":"c_123","amount":50,"currency":"USD"}'),
'prod','','op@example.com','note','idem_1',
'<HARNESS>','https://api.tessra.ai'
);