@elevasis/sdk 0.4.5 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/cli.cjs +829 -413
  2. package/dist/index.d.ts +79 -14
  3. package/dist/index.js +17 -12
  4. package/dist/templates.js +747 -0
  5. package/dist/types/templates.d.ts +1 -0
  6. package/dist/types/worker/index.d.ts +6 -0
  7. package/dist/types/worker/platform.d.ts +32 -0
  8. package/dist/worker/index.js +4701 -9
  9. package/package.json +10 -3
  10. package/reference/_index.md +95 -0
  11. package/reference/_navigation.md +104 -0
  12. package/reference/cli/index.mdx +497 -0
  13. package/reference/concepts/index.mdx +203 -0
  14. package/reference/deployment/api.mdx +297 -0
  15. package/reference/deployment/index.mdx +153 -0
  16. package/reference/developer/interaction-guidance.mdx +213 -0
  17. package/reference/framework/agent.mdx +175 -0
  18. package/reference/framework/documentation.mdx +92 -0
  19. package/reference/framework/index.mdx +95 -0
  20. package/reference/framework/memory.mdx +337 -0
  21. package/reference/framework/project-structure.mdx +294 -0
  22. package/reference/getting-started/index.mdx +148 -0
  23. package/reference/index.mdx +113 -0
  24. package/reference/platform-tools/examples.mdx +187 -0
  25. package/reference/platform-tools/index.mdx +182 -0
  26. package/reference/resources/index.mdx +289 -0
  27. package/reference/resources/patterns.mdx +341 -0
  28. package/reference/resources/types.mdx +207 -0
  29. package/reference/roadmap/index.mdx +147 -0
  30. package/reference/runtime/index.mdx +141 -0
  31. package/reference/runtime/limits.mdx +77 -0
  32. package/reference/security/credentials.mdx +141 -0
  33. package/reference/templates/data-enrichment.mdx +162 -0
  34. package/reference/templates/email-sender.mdx +135 -0
  35. package/reference/templates/lead-scorer.mdx +175 -0
  36. package/reference/templates/pdf-generator.mdx +151 -0
  37. package/reference/templates/recurring-job.mdx +189 -0
  38. package/reference/templates/text-classifier.mdx +147 -0
  39. package/reference/templates/web-scraper.mdx +135 -0
  40. package/reference/troubleshooting/common-errors.mdx +210 -0
@@ -0,0 +1,148 @@
1
+ ---
2
+ title: Getting Started
3
+ description: Install the Elevasis SDK, scaffold a project, and run your first deployment
4
+ loadWhen: "Setting up a new project or onboarding"
5
+ ---
6
+
7
+ This guide takes you from a fresh install to a running deployment in four steps: install, scaffold, deploy, and execute.
8
+
9
+ ## Installation
10
+
11
+ Install the SDK and its peer dependency:
12
+
13
+ ```bash
14
+ npm install @elevasis/sdk zod
15
+ # or
16
+ pnpm add @elevasis/sdk zod
17
+ ```
18
+
19
+ The `.npmrc` file scaffolded by `elevasis init` sets `auto-install-peers = true`, so peer dependencies are handled automatically on subsequent installs.
20
+
21
+ ---
22
+
23
+ ## Scaffold a Project
24
+
25
+ Run `elevasis init` to create a new project directory with all required files:
26
+
27
+ ```bash
28
+ elevasis init my-project
29
+ cd my-project
30
+ ```
31
+
32
+ The command scaffolds 23 files covering configuration, source, documentation, and Claude Code integration:
33
+
34
+ ```
35
+ my-project/
36
+ ├── CLAUDE.md # Project instructions for Claude Code
37
+ ├── .claude/
38
+ │ ├── settings.json # autoCompact: false
39
+ │ └── commands/
40
+ │ ├── docs.md # Documentation lifecycle
41
+ │ ├── resource.md # Resource scaffolding
42
+ │ ├── meta.md # Project lifecycle (init, deploy, health, develop)
43
+ │ ├── help.md # Command tree and navigation
44
+ │ ├── database.md # Database setup and management
45
+ │ ├── agent.md # Agent development
46
+ │ ├── templates.md # Workflow templates
47
+ │ ├── tutorial.md # Progressive learning
48
+ │ └── profile.md # View and update user profile
49
+ ├── src/
50
+ │ ├── index.ts # Registry entry point
51
+ │ └── workflows/
52
+ │ └── echo.ts # Starter workflow
53
+ ├── docs/
54
+ │ ├── index.mdx # Starter documentation page
55
+ │ └── in-progress/
56
+ │ └── .gitkeep # Work-in-progress docs directory
57
+ ├── elevasis.config.ts # Config with templateVersion and options
58
+ ├── package.json # check-types + deploy scripts
59
+ ├── tsconfig.json # TypeScript config (app-focused)
60
+ ├── pnpm-workspace.yaml # Standalone project workspace
61
+ ├── .env # API key only
62
+ ├── .env.example # Git-safe template
63
+ ├── .npmrc # auto-install-peers
64
+ └── .gitignore # Excludes worker temp file, claude files
65
+ ```
66
+
67
+ The scaffolded `elevasis.config.ts` includes a `templateVersion` field that tracks which template generation your project uses. Leave it as-is -- it is managed automatically by `elevasis update`:
68
+
69
+ ```ts
70
+ import type { ElevasConfig } from '@elevasis/sdk'
71
+
72
+ export default {
73
+ templateVersion: 4,
74
+ } satisfies ElevasConfig
75
+ ```
76
+
77
+ ### Set Up Your API Key
78
+
79
+ Open `.env` and set your API key:
80
+
81
+ ```
82
+ ELEVASIS_API_KEY=sk_your_key_here
83
+ ```
84
+
85
+ The `.env.example` file provides the same template and is safe to commit. The actual `.env` is gitignored.
86
+
87
+ **Note:** Do not add `NODE_ENV` to your `.env`. The SDK treats `undefined` as production by default, which means your project connects to the hosted Elevasis API. Adding `NODE_ENV=development` is the most common setup mistake.
88
+
89
+ ### Guided Setup with Claude Code
90
+
91
+ After scaffolding, open the project in Claude Code and run `/meta init`. This command installs dependencies, walks you through `.env` setup, creates your developer profile in `.claude/memory/`, and optionally runs your first deploy -- all in one guided flow.
92
+
93
+ ---
94
+
95
+ ## First Deployment
96
+
97
+ Validate your resources and deploy:
98
+
99
+ ```bash
100
+ elevasis check # Validate resource definitions
101
+ elevasis deploy # Bundle and deploy to the platform
102
+ ```
103
+
104
+ `elevasis check` runs validation without deploying. Fix any errors it reports before running `elevasis deploy`.
105
+
106
+ `elevasis deploy` bundles your `src/` code and `docs/` documentation into a single deployment transaction. Both ship atomically -- there is no separate upload step for documentation.
107
+
108
+ After a successful deploy, confirm the resources are live:
109
+
110
+ ```bash
111
+ elevasis resources # List deployed resources
112
+ elevasis deployments # Show deployment history
113
+ ```
114
+
115
+ ---
116
+
117
+ ## First Execution
118
+
119
+ Execute the scaffolded echo workflow to verify end-to-end connectivity:
120
+
121
+ ```bash
122
+ elevasis exec echo --input '{"message": "hello"}'
123
+ ```
124
+
125
+ View the execution result:
126
+
127
+ ```bash
128
+ elevasis executions echo # Execution history
129
+ elevasis execution echo \<execution-id\> # Full detail for one execution
130
+ ```
131
+
132
+ Replace `<execution-id>` with the ID returned from the executions list.
133
+
134
+ ---
135
+
136
+ ## Next Steps
137
+
138
+ - **Run `/meta init` in Claude Code** -- Guided setup that installs deps, configures `.env`, and creates your developer profile in `.claude/memory/`
139
+ - [Development Framework](../framework/index.mdx) -- How Claude Code helps you build
140
+ - [Resources](../resources/index.mdx) -- Define workflows and agents
141
+ - [CLI Reference](../cli/index.mdx) -- Full command reference with flags
142
+ - [Deployment](../deployment/index.mdx) -- Deployment lifecycle and environment variables
143
+
144
+ When a new SDK version is released, run `elevasis update` to bring your project's managed files (CLAUDE.md, slash commands, `.gitignore`) up to date. The command adds missing files and flags any files that differ from the new template for agent-assisted review.
145
+
146
+ ---
147
+
148
+ **Last Updated:** 2026-02-25
@@ -0,0 +1,113 @@
1
+ ---
2
+ title: Elevasis SDK
3
+ description: Build and deploy workflows, agents, and resources with the Elevasis SDK
4
+ loadWhen: "First session or new to the SDK"
5
+ ---
6
+
7
+ `@elevasis/sdk` lets you build workflows, agents, and resources in TypeScript and deploy them to the Elevasis platform with a single command. The developer experience is Vercel-style: write TypeScript, validate locally, deploy -- the platform handles execution, tool access, and observability. You never manage infrastructure. Zod 4.1 is the only peer dependency.
8
+
9
+ ## Quick Start
10
+
11
+ ```bash
12
+ npm install @elevasis/sdk
13
+ elevasis init
14
+ elevasis deploy
15
+ ```
16
+
17
+ After `elevasis init`, your project is scaffolded with a working echo workflow, config file, TypeScript setup, and a `CLAUDE.md` that gives Claude Code full awareness of the SDK. After `elevasis deploy`, your resources appear in AI Studio and are available to run immediately.
18
+
19
+ Here is a minimal workflow definition:
20
+
21
+ ```ts
22
+ import { WorkflowDefinition, OrganizationResources } from '@elevasis/sdk';
23
+ import { z } from 'zod';
24
+
25
+ const greetInput = z.object({ name: z.string() });
26
+ const greetOutput = z.object({ message: z.string() });
27
+
28
+ type GreetInput = z.infer<typeof greetInput>;
29
+ type GreetOutput = z.infer<typeof greetOutput>;
30
+
31
+ const greetWorkflow: WorkflowDefinition = {
32
+ id: 'greet',
33
+ name: 'Greet',
34
+ inputSchema: greetInput,
35
+ outputSchema: greetOutput,
36
+ steps: [
37
+ {
38
+ id: 'greet-step',
39
+ name: 'Build greeting',
40
+ handler: async (input: GreetInput): Promise<GreetOutput> => {
41
+ return { message: `Hello, ${input.name}!` };
42
+ },
43
+ next: null,
44
+ },
45
+ ],
46
+ };
47
+
48
+ export const resources: OrganizationResources = {
49
+ workflows: [greetWorkflow],
50
+ };
51
+ ```
52
+
53
+ ## What You Can Build
54
+
55
+ - **Workflows** -- Step-based automation with typed inputs and outputs. Steps can be linear, conditional, or branching. Each step is a plain async function. Workflows are the primary resource type and are fully supported.
56
+ - **Agents** -- Autonomous AI resources with access to platform tools. Agent definitions are accepted by the SDK and appear in the registry, but autonomous agent execution (multi-turn tool use loops) is deferred -- see Known Limitations below.
57
+
58
+ ## Platform Tools
59
+
60
+ Inside any workflow step, import `platform` from `@elevasis/sdk/worker` to call platform tools:
61
+
62
+ ```ts
63
+ import { platform } from '@elevasis/sdk/worker';
64
+
65
+ const result = await platform.call({
66
+ tool: 'gmail',
67
+ method: 'send',
68
+ params: { to: 'user@example.com', subject: 'Hello', body: 'World' },
69
+ credential: 'my-gmail-credential',
70
+ });
71
+ ```
72
+
73
+ The platform exposes 70+ tools across 13 integration adapters -- Gmail, Stripe, Google Sheets, Notion, and more. Credentials are managed server-side; API keys never cross the execution boundary. LLM calls are also available via `platform.call({ tool: 'llm', ... })` with API keys resolved from platform environment variables.
74
+
75
+ See [Platform Tools](platform-tools/index.mdx) for the full catalog.
76
+
77
+ ## Known Limitations
78
+
79
+ - **Agent execution is deferred** -- The worker runtime returns a failed status for agent resources. LLM calls are available via `platform.call`, but autonomous multi-turn agent loops are not yet supported.
80
+ - **No streaming logs** -- Execution logs are returned in the response body after completion. Real-time log streaming is not available.
81
+
82
+ ## Documentation
83
+
84
+ ### Getting Started
85
+
86
+ - [Getting Started](getting-started/index.mdx) - Installation, authentication, first workflow, and project structure
87
+
88
+ ### Core Concepts
89
+
90
+ - [Resources](resources/index.mdx) - Workflow and agent definition patterns, Zod schemas, step types, and routing
91
+ - [Platform Tools](platform-tools/index.mdx) - Full catalog of 70+ tools, integration adapters, and credential management
92
+ - [Security](security/credentials.mdx) - Three-layer credential model, HTTP tool patterns, and credential management
93
+
94
+ ### Reference
95
+
96
+ - [Concepts](concepts/index.mdx) - Plain-English concept explanations, glossary, Zod guide, execution model, and common errors
97
+ - [Templates](templates/index.mdx) - 7 workflow templates: web-scraper, data-enrichment, email-sender, lead-scorer, and more
98
+ - [CLI Reference](cli/index.mdx) - All CLI commands: check, deploy, exec, resources, executions, env, and more
99
+ - [Deployment](deployment/index.mdx) - Deploy pipeline, versioning, bundle upload, and registry registration
100
+ - [Runtime](runtime/index.mdx) - Worker execution model, concurrency, timeouts, cancellation, and resource limits
101
+
102
+ ### Framework
103
+
104
+ - [Development Framework](framework/index.mdx) - How Claude Code helps you build: project structure, agent integration, memory, and documentation
105
+
106
+ ### Developer Tools
107
+
108
+ - [Documentation](framework/documentation.mdx) - Writing and deploying MDX documentation alongside your resources
109
+ - [Roadmap](roadmap/index.mdx) - Planned features including agent execution, streaming logs, and SDK testing utilities
110
+
111
+ ---
112
+
113
+ **Last Updated:** 2026-02-25
@@ -0,0 +1,187 @@
1
+ ---
2
+ title: Integration Examples
3
+ description: Common platform.call() patterns for email, CRM, PDF, LLM inference, resource triggering, and storage
4
+ loadWhen: "Implementing a platform tool call in a workflow step"
5
+ ---
6
+
7
+ Common `platform.call()` patterns ready to use in your SDK workflows. Each example shows the complete invocation including tool name, method, params, and credential (where required).
8
+
9
+ ## Sending Email via Resend
10
+
11
+ Send a transactional email through your Resend account. Store your Resend API key as a credential named `resend` using the [Elevasis CLI](../cli/index.mdx).
12
+
13
+ ```typescript
14
+ const result = await platform.call({
15
+ tool: 'resend',
16
+ method: 'sendEmail',
17
+ credential: 'resend',
18
+ params: {
19
+ from: 'hello@yourapp.com',
20
+ to: 'customer@example.com',
21
+ subject: 'Your order is confirmed',
22
+ html: '<p>Thank you for your order!</p>'
23
+ }
24
+ })
25
+ ```
26
+
27
+ The `credential` value must match the name you used when storing the API key. Resend supports `{ apiKey }` as its credential shape.
28
+
29
+ ## Creating a CRM Record via Attio
30
+
31
+ Create a contact or company record in Attio. Store your Attio API key as a credential named `attio`.
32
+
33
+ ```typescript
34
+ const result = await platform.call({
35
+ tool: 'attio',
36
+ method: 'createRecord',
37
+ credential: 'attio',
38
+ params: {
39
+ objectType: 'people',
40
+ attributes: {
41
+ name: [{ full_name: 'Jane Smith' }],
42
+ email_addresses: [{ email_address: 'jane@example.com' }],
43
+ company: 'Acme Corp'
44
+ }
45
+ }
46
+ })
47
+
48
+ // result.data.id is the new record ID
49
+ const recordId = result.data.id
50
+ ```
51
+
52
+ Attio exposes 11 tools covering CRUD operations, schema inspection, and notes. See the Attio adapter documentation for the full method list.
53
+
54
+ ## Generating a PDF
55
+
56
+ Render a PDF from an HTML string or a registered template. No credential required -- PDF generation is a built-in platform service.
57
+
58
+ ```typescript
59
+ const pdfBuffer = await platform.call({
60
+ tool: 'pdf',
61
+ method: 'renderToBuffer',
62
+ params: {
63
+ html: `
64
+ <h1>Invoice #1042</h1>
65
+ <p>Customer: Jane Smith</p>
66
+ <p>Amount due: $450.00</p>
67
+ `,
68
+ options: {
69
+ format: 'A4',
70
+ margin: { top: '20mm', bottom: '20mm', left: '15mm', right: '15mm' }
71
+ }
72
+ }
73
+ })
74
+
75
+ // Upload the buffer to storage for later retrieval
76
+ await platform.call({
77
+ tool: 'storage',
78
+ method: 'upload',
79
+ params: {
80
+ path: 'invoices/invoice-1042.pdf',
81
+ data: pdfBuffer,
82
+ contentType: 'application/pdf'
83
+ }
84
+ })
85
+ ```
86
+
87
+ ## Making an LLM Call with Structured Output
88
+
89
+ Use the `llm` tool to call any supported model with a JSON Schema for structured output. No API keys are needed in your code -- keys are resolved server-side.
90
+
91
+ ```typescript
92
+ const classification = await platform.call({
93
+ tool: 'llm',
94
+ method: 'generate',
95
+ params: {
96
+ provider: 'anthropic',
97
+ model: 'claude-sonnet-4-5',
98
+ messages: [
99
+ {
100
+ role: 'system',
101
+ content: 'You extract structured data from support tickets. Return valid JSON matching the schema.'
102
+ },
103
+ {
104
+ role: 'user',
105
+ content: ticketText
106
+ }
107
+ ],
108
+ responseSchema: {
109
+ type: 'object',
110
+ properties: {
111
+ priority: { type: 'string', enum: ['low', 'medium', 'high', 'critical'] },
112
+ category: { type: 'string', enum: ['billing', 'technical', 'account', 'other'] },
113
+ sentiment: { type: 'string', enum: ['positive', 'neutral', 'negative'] },
114
+ summary: { type: 'string' }
115
+ },
116
+ required: ['priority', 'category', 'sentiment', 'summary']
117
+ },
118
+ temperature: 0.1
119
+ }
120
+ })
121
+
122
+ // classification = { priority: 'high', category: 'technical', sentiment: 'negative', summary: '...' }
123
+ ```
124
+
125
+ Supported providers: `google`, `openai`, `anthropic`, `openrouter`. See [Platform Tools](index.mdx) for the full model list.
126
+
127
+ ## Triggering Another Resource
128
+
129
+ Trigger a separate workflow or agent as a nested child execution. The call is synchronous -- your workflow waits for the child to complete and receives its output.
130
+
131
+ ```typescript
132
+ const outcome = await platform.call({
133
+ tool: 'execution',
134
+ method: 'trigger',
135
+ params: {
136
+ resourceId: 'send-welcome-sequence',
137
+ input: {
138
+ userId: newUser.id,
139
+ email: newUser.email,
140
+ plan: 'pro'
141
+ }
142
+ }
143
+ })
144
+
145
+ if (!outcome.success) {
146
+ throw new Error(`Child workflow failed: ${outcome.error}`)
147
+ }
148
+
149
+ // outcome = { success: true, executionId: '...', output: { emailsSent: 3 }, error: undefined }
150
+ ```
151
+
152
+ Nested executions are tracked with depth up to a maximum of 5 levels. Both the calling workflow and the child must belong to the same organization.
153
+
154
+ ## Uploading to Storage
155
+
156
+ Upload a file to Elevasis-managed storage and generate a signed URL for temporary access. No credential required.
157
+
158
+ ```typescript
159
+ // Upload a processed file
160
+ await platform.call({
161
+ tool: 'storage',
162
+ method: 'upload',
163
+ params: {
164
+ path: `exports/${organizationSlug}/report-${Date.now()}.csv`,
165
+ data: csvContent,
166
+ contentType: 'text/csv'
167
+ }
168
+ })
169
+
170
+ // Generate a signed URL valid for 1 hour (3600 seconds)
171
+ const { signedUrl } = await platform.call({
172
+ tool: 'storage',
173
+ method: 'createSignedUrl',
174
+ params: {
175
+ path: `exports/${organizationSlug}/report-${Date.now()}.csv`,
176
+ expiresIn: 3600
177
+ }
178
+ })
179
+
180
+ // Share signedUrl with the user or include in an email
181
+ ```
182
+
183
+ Storage also supports `download`, `delete`, and `list` operations. Use `list` to enumerate files under a path prefix.
184
+
185
+ ---
186
+
187
+ **Last Updated:** 2026-02-25
@@ -0,0 +1,182 @@
1
+ ---
2
+ title: Platform Tools
3
+ description: Access 70+ tools across integration adapters and platform services from your SDK workflows via platform.call()
4
+ loadWhen: "Connecting to external services"
5
+ ---
6
+
7
+ `platform.call()` gives your SDK workflows access to the same 70+ tools that internal Elevasis agents use -- Gmail, Stripe, Google Sheets, PDF generation, human-in-the-loop approvals, storage, scheduling, and more. Credentials are managed server-side and never appear in your code. You pass a tool name, method, and parameters; Elevasis handles credential lookup, rate limiting, and retry transparently.
8
+
9
+ All tools share the same interface regardless of type: integration adapters (third-party APIs) and platform services (built-in Elevasis capabilities) are both called the same way.
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ const result = await platform.call({
15
+ tool: 'resend', // tool name (integration adapter or platform service)
16
+ method: 'sendEmail', // method exposed by that tool
17
+ params: { ... }, // method-specific parameters
18
+ credential: 'my-resend' // credential name (integration tools only)
19
+ })
20
+ ```
21
+
22
+ `platform.call()` returns a Promise that resolves with the tool result or rejects with a `PlatformToolError` containing a message, error code, and a `retryable` flag.
23
+
24
+ ## Integration Adapters
25
+
26
+ Thirteen integration adapters give you access to 70+ tool methods covering third-party APIs. Pass the `credential` field with the name of the stored credential for that service.
27
+
28
+ | Adapter | Tools | Credential Shape |
29
+ | --- | --- | --- |
30
+ | Attio | 11 (CRUD + schema + notes) | `{ apiKey }` |
31
+ | Google Sheets | 13 (read/write/filter/upsert) | OAuth2 / service account |
32
+ | Trello | 10 (cards/lists/checklists) | `{ apiKey, token }` |
33
+ | Notion | 8 (pages + blocks) | `{ token }` |
34
+ | Stripe | 6 (payment links + checkout) | `{ secretKey }` |
35
+ | Instantly | 5 (email campaigns) | `{ apiKey }` |
36
+ | Gmail | 2 (send email) | OAuth2 / service account |
37
+ | Resend | 3 (send/get email) | `{ apiKey }` |
38
+ | SignatureAPI | 3 (envelopes) | `{ apiKey }` |
39
+ | Dropbox | 2 (upload/folder) | `{ accessToken }` |
40
+ | Apify | 1 (run actor) | `{ token }` |
41
+ | Mailso | 1 (verify email) | `{ apiKey }` |
42
+ | Supabase | 7 (insert/select/update/delete/upsert/rpc/count) | `{ url, serviceRoleKey }` |
43
+
44
+ Credentials are stored in the Elevasis credentials table and injected server-side. The credential name you pass in `credential` must match the name you set when storing the credential.
45
+
46
+ ## Platform Services
47
+
48
+ Nine built-in platform services are available without a `credential` field. These are Elevasis-managed capabilities.
49
+
50
+ | Tool Key | Methods | Purpose |
51
+ | --- | --- | --- |
52
+ | `email` | `send` | Send transactional email via Elevasis email service |
53
+ | `storage` | `upload`, `download`, `createSignedUrl`, `delete`, `list` | File storage operations |
54
+ | `pdf` | `render`, `renderToBuffer` | Generate PDFs from templates or HTML |
55
+ | `notification` | `create` | Create in-app notifications |
56
+ | `approval` | `create`, `deleteByMetadata` | Human-in-the-loop approval gates |
57
+ | `scheduler` | `createSchedule`, `updateAnchor`, `deleteSchedule`, `findByIdempotencyKey`, `deleteScheduleByIdempotencyKey`, `listSchedules`, `getSchedule`, `cancelSchedule`, `cancelSchedulesByMetadata` | Task scheduling |
58
+ | `lead` | Dynamic (all methods) | Lead management operations |
59
+ | `llm` | `generate` | LLM inference across multiple providers |
60
+ | `execution` | `trigger` | Trigger another resource as a nested child execution |
61
+
62
+ ## LLM Tool
63
+
64
+ Call any supported LLM from your workflow with no API keys required. Keys are resolved server-side from environment variables.
65
+
66
+ ```typescript
67
+ const result = await platform.call({
68
+ tool: 'llm',
69
+ method: 'generate',
70
+ params: {
71
+ provider: 'google',
72
+ model: 'gemini-3-flash-preview',
73
+ messages: [
74
+ { role: 'system', content: 'Classify this email reply.' },
75
+ { role: 'user', content: emailText }
76
+ ],
77
+ responseSchema: {
78
+ type: 'object',
79
+ properties: {
80
+ category: { type: 'string', enum: ['interested', 'not-interested', 'bounced'] },
81
+ confidence: { type: 'number', minimum: 0, maximum: 1 }
82
+ },
83
+ required: ['category', 'confidence']
84
+ },
85
+ temperature: 0.2
86
+ }
87
+ })
88
+ ```
89
+
90
+ **Supported models:**
91
+
92
+ | Provider | Models |
93
+ | --- | --- |
94
+ | `google` | `gemini-3-flash-preview` |
95
+ | `openai` | `gpt-5`, `gpt-5-mini` |
96
+ | `anthropic` | `claude-opus-4-5`, `claude-sonnet-4-5`, `claude-haiku-4-5` |
97
+ | `openrouter` | `openrouter/anthropic/claude-sonnet-4.5`, `openrouter/deepseek/deepseek-v3.2`, `openrouter/x-ai/grok-4.1-fast` |
98
+
99
+ **Key params:**
100
+
101
+ - `provider` -- one of `google`, `openai`, `anthropic`, `openrouter`
102
+ - `model` -- model identifier from the table above
103
+ - `messages` -- array of `{ role, content }` objects
104
+ - `responseSchema` -- optional JSON Schema for structured output
105
+ - `temperature` -- optional, controls output randomness
106
+
107
+ ## Execution Tool
108
+
109
+ Trigger another resource (workflow or agent) as a nested child of the current execution. The child runs synchronously and its result is returned. Depth is tracked automatically up to a maximum of 5 levels to prevent infinite recursion.
110
+
111
+ ```typescript
112
+ const result = await platform.call({
113
+ tool: 'execution',
114
+ method: 'trigger',
115
+ params: {
116
+ resourceId: 'my-other-workflow',
117
+ input: { key: 'value' }
118
+ }
119
+ })
120
+ // result = { success: true, executionId: '...', output: { ... }, error: undefined }
121
+ ```
122
+
123
+ The invoked resource must belong to the same organization. The `organizationId` is always taken from the parent execution context -- you cannot invoke resources across organizations.
124
+
125
+ ## Managing Environment Variables
126
+
127
+ Use the `elevasis env` CLI to manage environment variables for your deployed workers:
128
+
129
+ ```bash
130
+ elevasis env list
131
+ elevasis env set KEY value
132
+ elevasis env remove KEY
133
+ ```
134
+
135
+ Environment variables set this way are injected into your worker process at startup and are available via `process.env`.
136
+
137
+ ## Database Access
138
+
139
+ Supabase is a first-class integration adapter that gives your workflows persistent storage using the same `platform.call()` interface as every other tool. Pass the `credential` field with the name of your stored Supabase credential.
140
+
141
+ **Methods:** `insert`, `select`, `update`, `delete`, `upsert`, `rpc`, `count`
142
+
143
+ ```typescript
144
+ // Select rows with filters
145
+ const qualified = await platform.call({
146
+ tool: 'supabase',
147
+ credential: 'my-database',
148
+ method: 'select',
149
+ params: {
150
+ table: 'leads',
151
+ filter: { status: 'eq.qualified', score: 'gte.80' },
152
+ order: { column: 'score', ascending: false },
153
+ limit: 50,
154
+ },
155
+ })
156
+ // Returns: [{ id: '...', name: 'Jane Doe', score: 92, ... }, ...]
157
+ ```
158
+
159
+ **Filter syntax** uses PostgREST string format (`operator.value`):
160
+
161
+ | Filter | Example | Meaning |
162
+ | --- | --- | --- |
163
+ | `eq` | `{ status: 'eq.qualified' }` | Equals |
164
+ | `neq` | `{ status: 'neq.lost' }` | Not equals |
165
+ | `gt`, `gte`, `lt`, `lte` | `{ score: 'gte.80' }` | Comparisons |
166
+ | `like`, `ilike` | `{ name: 'ilike.%jane%' }` | Pattern match |
167
+ | `in` | `{ status: 'in.(new,contacted)' }` | In set |
168
+ | `is` | `{ deleted_at: 'is.null' }` | Null check |
169
+
170
+ **Credential setup:** Create a credential with provider `supabase` in the command center. The config fields are `url` (your Supabase project URL) and `serviceRoleKey` (the service role key from Settings > API). Workflows always use the service role key -- server-side execution, no RLS.
171
+
172
+ **`/database init`:** A guided setup command that stores your Supabase credential, generates `data/schema.ts`, and creates `docs/database.mdx`.
173
+
174
+ **`data/schema.ts`:** An agent-readable Zod schema that documents your table structure. It is NOT deployed and NOT executed -- the agent reads it to understand your data model when writing workflow steps or generating queries.
175
+
176
+ ## Documentation
177
+
178
+ - [Integration Examples](examples.mdx) - Common `platform.call()` patterns with working code for email, CRM, PDF, LLM, and more
179
+
180
+ ---
181
+
182
+ **Last Updated:** 2026-02-25