Run your own sandboxed JavaScript inside PortableMind — on a schedule, on a record change, or as a tool your agents can call.
Run your own logic inside PortableMind — small JavaScript functions that read and write your data, call external APIs, run on a schedule, or fire when a record changes. No service to deploy.
Dynamic Functions: sandboxed JavaScript stored in the platform, executed as a background job. Trigger them manually, on a cron schedule, from an MCP tool, or as a model lifecycle callback.
context with params, tenant_id, the current user, and helpers like execute_action(model, action, params) to read/write tenant data and shareRecord(model, id, partyId, level) to share what you create (viewer/commenter/editor/full_access — never owner, and only what the function's user could share anyway).POST /api/v1/dynamic_functions/:id/execute { params, async: true }
By default the function runs with the caller's permissions. Turn on "API executes as run-as user" to run it with the function's run_as_user instead (the caller is still recorded for audit) — that's how a least-privilege user can trigger a function that needs service-level access. The execute permission can also be granted per function, not just tenant-wide.0 9 * * 1 (9am Mondays).callback_model: 'Project', callback_event: 'create'. Supported models include Party, User (e.g. offboarding cleanup on destroy), Project, Task, BizTxnEvent and more — and teams created through signup fire Party create callbacks too.dynamic_function_executions so you can see exactly what happened.editor share lets you update, never delete), and a list filter the platform can't apply raises an error instead of silently returning everything — so automation never acts on a lie.A lightweight automation layer that lives next to your data: a weekly rollup that posts to a conversation, a sync that fires whenever a project is created, an enrichment step an agent can call as a tool. It's serverless from your side — write the function, pick the trigger, done.
Your agents can run your function too — via the execute endpoint or the dynamic-function tools — so your custom logic becomes part of what they can do.