Run actions
Call a single catalogue action as an ad-hoc SDK Execution.
Use lunnoa.actions.run when you need one app action without building a workflow graph. The platform creates a one-step Execution with source: SDK, runs the action through the same path as workflow steps, then finalises that Execution. These examples assume an authenticated lunnoa client from the overview.
Discover app and action IDs
Catalogue metadata (including each action's inputConfig) comes from the CLI or workflowApps.list(). Prefer npx @lunnoa/client tools list --json then tools get <actionId> --json when a coding agent is choosing appId and actionId. lunnoa.actions.get(appId, actionId) only looks up one action you already know.
See also Discovery.
Run an action
actions.run returns the Execution id plus the synchronous status, output, and single-step executionPath. Both examples below use real catalogue apps that need a Connection instance UUID (connectionId). Copy it from Connections in the product UI, or from lunnoa.connections.list().
Read Outlook mail
Retrieves one message with microsoft-outlook_action_get-email-by-id. Message IDs usually come from an Outlook Email Received trigger payload or from Microsoft Graph.
Send a Slack message
Posts to a channel with slack_action_send-message-to-channel. Pass the Slack channel ID (for example C0123456789), not the #channel-name. Invite the Lunnoa bot to the channel first (/invite @Lunnoa Labs).
Connection UUID rules
When an action has needsConnection: true, pass the Connection instance UUID (Connection.id), not the catalogue connection-type key.
| Situation | Behaviour |
|---|---|
connectionId provided | Used after auth checks (canUseConnection) and app match |
Omitted, exactly one connection for that workflowAppId | That connection is used |
| Omitted, multiple connections | 400 listing that connectionId is required (fail-closed; no silent “oldest wins”) |
| Omitted, none | 400 asking you to create a connection or pass connectionId |
Copy the UUID from Connections in the product UI (table ID column or connection detail page), or from lunnoa.connections.list().
Project scoping follows the same fail-closed pattern: pass projectId when the workspace has more than one project.
Poll like any other Execution
The run appears in executions.list with source: SDK. Filter with filterBy: ['source:SDK'] when you only want ad-hoc runs.
Render progress from executionPath, the same as workflow runs. See Workflows.
Permissions
POST /api/actions/run is Public API (@PublicApi): API keys (lna_…) and user JWTs both work. The caller needs workflows:execute (plus connection access when a connection is used).
Related
- Start runs: linear multi-step SDK Executions (
runs.start) - Define locally:
defineAction/defineWorkflowfactories - Workflows: multi-step graph runs and
NEEDS_INPUT - Discovery: catalogue and schema inspection
- Toolkit Actions: authoring actions with
@lunnoa/toolkit(different job) - API reference:
POST /api/actions/run