@elevasis/sdk 0.4.6 → 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.
- package/dist/cli.cjs +814 -451
- package/dist/index.d.ts +79 -14
- package/dist/index.js +17 -12
- package/dist/templates.js +747 -0
- package/dist/types/templates.d.ts +1 -0
- package/dist/types/worker/index.d.ts +6 -0
- package/dist/types/worker/platform.d.ts +32 -0
- package/dist/worker/index.js +4701 -9
- package/package.json +16 -10
- package/reference/_index.md +48 -6
- package/reference/_navigation.md +104 -0
- package/reference/cli/index.mdx +2 -1
- package/reference/concepts/index.mdx +203 -0
- package/reference/deployment/api.mdx +1 -0
- package/reference/deployment/index.mdx +1 -0
- package/reference/developer/interaction-guidance.mdx +213 -0
- package/reference/framework/agent.mdx +175 -0
- package/reference/{documentation/index.mdx → framework/documentation.mdx} +1 -0
- package/reference/framework/index.mdx +95 -0
- package/reference/framework/memory.mdx +337 -0
- package/reference/framework/project-structure.mdx +294 -0
- package/reference/getting-started/index.mdx +39 -15
- package/reference/index.mdx +10 -2
- package/reference/platform-tools/examples.mdx +1 -0
- package/reference/platform-tools/index.mdx +43 -2
- package/reference/resources/index.mdx +1 -0
- package/reference/resources/patterns.mdx +2 -1
- package/reference/resources/types.mdx +1 -0
- package/reference/roadmap/index.mdx +1 -0
- package/reference/runtime/index.mdx +1 -0
- package/reference/runtime/limits.mdx +1 -0
- package/reference/security/credentials.mdx +141 -0
- package/reference/templates/data-enrichment.mdx +162 -0
- package/reference/templates/email-sender.mdx +135 -0
- package/reference/templates/lead-scorer.mdx +175 -0
- package/reference/templates/pdf-generator.mdx +151 -0
- package/reference/templates/recurring-job.mdx +189 -0
- package/reference/templates/text-classifier.mdx +147 -0
- package/reference/templates/web-scraper.mdx +135 -0
- package/reference/troubleshooting/common-errors.mdx +210 -0
- package/reference/getting-started/project-structure.mdx +0 -148
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elevasis/sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"description": "SDK for building Elevasis organization resources",
|
|
5
5
|
"comment:bin": "IMPORTANT: This package shares the 'elevasis' binary name with @repo/cli. They never conflict because @elevasis/sdk must NEVER be added as a dependency of any workspace package (apps/*, packages/*, organizations/*). Workspace projects use @repo/cli for the 'elevasis' binary. External developers (outside the workspace) get this SDK's binary via npm install.",
|
|
6
6
|
"type": "module",
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
"./worker": {
|
|
17
17
|
"types": "./dist/types/worker/index.d.ts",
|
|
18
18
|
"import": "./dist/worker/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./templates": {
|
|
21
|
+
"types": "./dist/types/templates.d.ts",
|
|
22
|
+
"import": "./dist/templates.js"
|
|
19
23
|
}
|
|
20
24
|
},
|
|
21
25
|
"files": [
|
|
@@ -25,8 +29,15 @@
|
|
|
25
29
|
"dist/types/worker/index.d.ts",
|
|
26
30
|
"dist/types/worker/platform.d.ts",
|
|
27
31
|
"dist/cli.cjs",
|
|
32
|
+
"dist/templates.js",
|
|
33
|
+
"dist/types/templates.d.ts",
|
|
28
34
|
"reference/"
|
|
29
35
|
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.core-dts.json && tsc -p tsconfig.build.json && tsup && rollup -c rollup.dts.config.mjs && esbuild src/cli/index.ts --bundle --platform=node --outfile=dist/cli.cjs --format=cjs --external:esbuild --external:jiti --banner:js=\"#!/usr/bin/env node\" && node scripts/copy-reference-docs.mjs && node scripts/generate-navigation.mjs",
|
|
38
|
+
"check-types": "tsc --noEmit",
|
|
39
|
+
"test:bundle": "pnpm build && vitest run --config vitest.bundle.config.ts"
|
|
40
|
+
},
|
|
30
41
|
"dependencies": {
|
|
31
42
|
"esbuild": "^0.25.0",
|
|
32
43
|
"jiti": "^2.0.0"
|
|
@@ -35,6 +46,8 @@
|
|
|
35
46
|
"zod": "^4.1.0"
|
|
36
47
|
},
|
|
37
48
|
"devDependencies": {
|
|
49
|
+
"@repo/core": "workspace:*",
|
|
50
|
+
"@repo/typescript-config": "workspace:*",
|
|
38
51
|
"@types/node": "^22.0.0",
|
|
39
52
|
"chalk": "^5.3.0",
|
|
40
53
|
"commander": "^11.0.0",
|
|
@@ -45,13 +58,6 @@
|
|
|
45
58
|
"rollup-plugin-dts": "^6.3.0",
|
|
46
59
|
"tsup": "^8.0.0",
|
|
47
60
|
"typescript": "5.9.2",
|
|
48
|
-
"zod": "^4.1.0"
|
|
49
|
-
"@repo/core": "0.0.0",
|
|
50
|
-
"@repo/typescript-config": "0.0.0"
|
|
51
|
-
},
|
|
52
|
-
"scripts": {
|
|
53
|
-
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.core-dts.json && tsc -p tsconfig.build.json && tsup && rollup -c rollup.dts.config.mjs && esbuild src/cli/index.ts --bundle --platform=node --outfile=dist/cli.cjs --format=cjs --external:esbuild --external:jiti --banner:js=\"#!/usr/bin/env node\" && node scripts/copy-reference-docs.mjs",
|
|
54
|
-
"check-types": "tsc --noEmit",
|
|
55
|
-
"test:bundle": "pnpm build && vitest run --config vitest.bundle.config.ts"
|
|
61
|
+
"zod": "^4.1.0"
|
|
56
62
|
}
|
|
57
|
-
}
|
|
63
|
+
}
|
package/reference/_index.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# SDK Reference Documentation
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
29 pages bundled from the Elevasis documentation site.
|
|
4
4
|
|
|
5
5
|
Browse these files for complete SDK reference including platform tools catalog,
|
|
6
6
|
resource types, runtime limits, deployment details, and CLI commands.
|
|
@@ -10,21 +10,36 @@ resource types, runtime limits, deployment details, and CLI commands.
|
|
|
10
10
|
- **CLI Reference** -- `cli/index.mdx`
|
|
11
11
|
Full reference for every elevasis CLI command -- scaffold, validate, deploy, execute, and inspect resources
|
|
12
12
|
|
|
13
|
+
- **Concepts Reference** -- `concepts/index.mdx`
|
|
14
|
+
Plain-English explanations of Elevasis SDK concepts -- glossary, workflow analogies, Zod schemas, execution model, platform tools, common errors, and design decisions
|
|
15
|
+
|
|
13
16
|
- **Execution API** -- `deployment/api.mdx`
|
|
14
17
|
REST endpoints for executing resources, querying execution history, and managing deployments via the Elevasis external API
|
|
15
18
|
|
|
16
19
|
- **Deploying Resources** -- `deployment/index.mdx`
|
|
17
20
|
How to deploy your Elevasis SDK resources to the platform using elevasis deploy, including configuration, validation, and environment setup
|
|
18
21
|
|
|
19
|
-
- **
|
|
22
|
+
- **Interaction Guidance** -- `developer/interaction-guidance.mdx`
|
|
23
|
+
Full dimensional adaptation rules per skill axis -- programming, TypeScript, API integration, automation concepts, domain expertise -- with growth tracking protocol
|
|
24
|
+
|
|
25
|
+
- **Agent System** -- `framework/agent.mdx`
|
|
26
|
+
CLAUDE.md drives all agent behavior -- project instructions, slash commands, memory-based developer profile, and three-tier adaptive guidance
|
|
27
|
+
|
|
28
|
+
- **Resource Documentation** -- `framework/documentation.mdx`
|
|
20
29
|
Write and deploy MDX documentation alongside your Elevasis resources
|
|
21
30
|
|
|
22
|
-
- **
|
|
23
|
-
|
|
31
|
+
- **Development Framework** -- `framework/index.mdx`
|
|
32
|
+
The SDK scaffolds a complete development environment for Claude Code -- project instructions, slash commands, cross-session memory, and template versioning
|
|
24
33
|
|
|
25
|
-
- **
|
|
34
|
+
- **Memory System** -- `framework/memory.mdx`
|
|
35
|
+
Cross-session project knowledge stored in .claude/memory/ -- deployment state, environment, decisions, and error patterns that persist between Claude Code sessions
|
|
36
|
+
|
|
37
|
+
- **Project Structure** -- `framework/project-structure.mdx`
|
|
26
38
|
Each file scaffolded by elevasis init and its purpose in the development workflow
|
|
27
39
|
|
|
40
|
+
- **Getting Started** -- `getting-started/index.mdx`
|
|
41
|
+
Install the Elevasis SDK, scaffold a project, and run your first deployment
|
|
42
|
+
|
|
28
43
|
- **Elevasis SDK** -- `index.mdx`
|
|
29
44
|
Build and deploy workflows, agents, and resources with the Elevasis SDK
|
|
30
45
|
|
|
@@ -32,7 +47,7 @@ resource types, runtime limits, deployment details, and CLI commands.
|
|
|
32
47
|
Common platform.call() patterns for email, CRM, PDF, LLM inference, resource triggering, and storage
|
|
33
48
|
|
|
34
49
|
- **Platform Tools** -- `platform-tools/index.mdx`
|
|
35
|
-
Access 70+ integration adapters and platform services from your SDK workflows via platform.call()
|
|
50
|
+
Access 70+ tools across integration adapters and platform services from your SDK workflows via platform.call()
|
|
36
51
|
|
|
37
52
|
- **Writing Resources** -- `resources/index.mdx`
|
|
38
53
|
Guide to creating workflows and agents using WorkflowDefinition, AgentDefinition, and OrganizationResources with the Elevasis SDK
|
|
@@ -51,3 +66,30 @@ resource types, runtime limits, deployment details, and CLI commands.
|
|
|
51
66
|
|
|
52
67
|
- **Resource Limits & Quotas** -- `runtime/limits.mdx`
|
|
53
68
|
Memory limits, execution timeouts, scale quotas, networking constraints, and v1 platform limitations for SDK resources
|
|
69
|
+
|
|
70
|
+
- **Credential Security** -- `security/credentials.mdx`
|
|
71
|
+
Three-layer credential model: platform tools (server-side injection), http tool (arbitrary APIs), getCredential() (explicit opt-in raw access) -- .env scope and security boundaries
|
|
72
|
+
|
|
73
|
+
- **Template: Data Enrichment** -- `templates/data-enrichment.mdx`
|
|
74
|
+
LLM-powered enrichment of existing database records -- read rows, enrich each with an LLM, write results back to Supabase
|
|
75
|
+
|
|
76
|
+
- **Template: Email Sender** -- `templates/email-sender.mdx`
|
|
77
|
+
Transactional email via Resend with template support -- send styled emails to one or multiple recipients
|
|
78
|
+
|
|
79
|
+
- **Template: Lead Scorer** -- `templates/lead-scorer.mdx`
|
|
80
|
+
LLM-based lead scoring with Supabase storage -- receive a lead, score it with an LLM, store the result
|
|
81
|
+
|
|
82
|
+
- **Template: PDF Generator** -- `templates/pdf-generator.mdx`
|
|
83
|
+
PDF generation from structured data with platform storage upload -- render a PDF from a template and upload to platform storage
|
|
84
|
+
|
|
85
|
+
- **Template: Recurring Job** -- `templates/recurring-job.mdx`
|
|
86
|
+
Scheduler-triggered periodic workflow -- run a task on a schedule (daily, weekly, hourly, or custom cron)
|
|
87
|
+
|
|
88
|
+
- **Template: Text Classifier** -- `templates/text-classifier.mdx`
|
|
89
|
+
Multi-label text classification with structured output -- classify text into predefined categories using an LLM with JSON output
|
|
90
|
+
|
|
91
|
+
- **Template: Web Scraper** -- `templates/web-scraper.mdx`
|
|
92
|
+
Apify-based web scraper that stores results in Supabase -- fetch structured data from any website via Apify actors
|
|
93
|
+
|
|
94
|
+
- **Common Errors** -- `troubleshooting/common-errors.mdx`
|
|
95
|
+
Static SDK-level error catalog -- CLI errors, deployment errors, schema validation, platform tool failures, and runtime errors with diagnostic steps
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# SDK Reference Navigation
|
|
2
|
+
|
|
3
|
+
Auto-generated from reference file frontmatter. 29 files indexed.
|
|
4
|
+
|
|
5
|
+
All paths are relative to `node_modules/@elevasis/sdk/reference/`.
|
|
6
|
+
|
|
7
|
+
## General
|
|
8
|
+
|
|
9
|
+
| Resource | Location | When to Load |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| Elevasis SDK | `index.mdx` | First session or new to the SDK |
|
|
12
|
+
|
|
13
|
+
## Cli
|
|
14
|
+
|
|
15
|
+
| Resource | Location | When to Load |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| CLI Reference | `cli/index.mdx` | Running CLI operations |
|
|
18
|
+
|
|
19
|
+
## Concepts
|
|
20
|
+
|
|
21
|
+
| Resource | Location | When to Load |
|
|
22
|
+
| --- | --- | --- |
|
|
23
|
+
| Concepts Reference | `concepts/index.mdx` | User asks what is or needs conceptual grounding |
|
|
24
|
+
|
|
25
|
+
## Deployment
|
|
26
|
+
|
|
27
|
+
| Resource | Location | When to Load |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| Execution API | `deployment/api.mdx` | Calling the API directly or debugging API responses |
|
|
30
|
+
| Deploying Resources | `deployment/index.mdx` | Preparing to deploy or debugging deploy failures |
|
|
31
|
+
|
|
32
|
+
## Developer
|
|
33
|
+
|
|
34
|
+
| Resource | Location | When to Load |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| Interaction Guidance | `developer/interaction-guidance.mdx` | Unsure how to adapt for a skill combination |
|
|
37
|
+
|
|
38
|
+
## Framework
|
|
39
|
+
|
|
40
|
+
| Resource | Location | When to Load |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| Agent System | `framework/agent.mdx` | Configuring agent behavior or capabilities |
|
|
43
|
+
| Resource Documentation | `framework/documentation.mdx` | Writing or updating project documentation |
|
|
44
|
+
| Development Framework | `framework/index.mdx` | Understanding the agent framework structure |
|
|
45
|
+
| Memory System | `framework/memory.mdx` | Working with agent memory or session state |
|
|
46
|
+
| Project Structure | `framework/project-structure.mdx` | Understanding scaffolded files or project layout |
|
|
47
|
+
|
|
48
|
+
## Getting-started
|
|
49
|
+
|
|
50
|
+
| Resource | Location | When to Load |
|
|
51
|
+
| --- | --- | --- |
|
|
52
|
+
| Getting Started | `getting-started/index.mdx` | Setting up a new project or onboarding |
|
|
53
|
+
|
|
54
|
+
## Platform-tools
|
|
55
|
+
|
|
56
|
+
| Resource | Location | When to Load |
|
|
57
|
+
| --- | --- | --- |
|
|
58
|
+
| Integration Examples | `platform-tools/examples.mdx` | Implementing a platform tool call in a workflow step |
|
|
59
|
+
| Platform Tools | `platform-tools/index.mdx` | Connecting to external services |
|
|
60
|
+
|
|
61
|
+
## Resources
|
|
62
|
+
|
|
63
|
+
| Resource | Location | When to Load |
|
|
64
|
+
| --- | --- | --- |
|
|
65
|
+
| Writing Resources | `resources/index.mdx` | Building or modifying a workflow |
|
|
66
|
+
| Common Patterns | `resources/patterns.mdx` | Building or modifying a workflow |
|
|
67
|
+
| SDK Types | `resources/types.mdx` | Looking up type signatures or SDK exports |
|
|
68
|
+
|
|
69
|
+
## Roadmap
|
|
70
|
+
|
|
71
|
+
| Resource | Location | When to Load |
|
|
72
|
+
| --- | --- | --- |
|
|
73
|
+
| Roadmap | `roadmap/index.mdx` | Asking about future features or planned capabilities |
|
|
74
|
+
|
|
75
|
+
## Runtime
|
|
76
|
+
|
|
77
|
+
| Resource | Location | When to Load |
|
|
78
|
+
| --- | --- | --- |
|
|
79
|
+
| Execution Runtime | `runtime/index.mdx` | Debugging execution behavior or understanding the runtime model |
|
|
80
|
+
| Resource Limits & Quotas | `runtime/limits.mdx` | Hitting resource limits or planning for scale |
|
|
81
|
+
|
|
82
|
+
## Security
|
|
83
|
+
|
|
84
|
+
| Resource | Location | When to Load |
|
|
85
|
+
| --- | --- | --- |
|
|
86
|
+
| Credential Security | `security/credentials.mdx` | Setting up integrations or configuring tool access |
|
|
87
|
+
|
|
88
|
+
## Templates
|
|
89
|
+
|
|
90
|
+
| Resource | Location | When to Load |
|
|
91
|
+
| --- | --- | --- |
|
|
92
|
+
| Template: Data Enrichment | `templates/data-enrichment.mdx` | Applying the data-enrichment workflow template |
|
|
93
|
+
| Template: Email Sender | `templates/email-sender.mdx` | Applying the email-sender workflow template |
|
|
94
|
+
| Template: Lead Scorer | `templates/lead-scorer.mdx` | Applying the lead-scorer workflow template |
|
|
95
|
+
| Template: PDF Generator | `templates/pdf-generator.mdx` | Applying the pdf-generator workflow template |
|
|
96
|
+
| Template: Recurring Job | `templates/recurring-job.mdx` | Applying the recurring-job workflow template |
|
|
97
|
+
| Template: Text Classifier | `templates/text-classifier.mdx` | Applying the text-classifier workflow template |
|
|
98
|
+
| Template: Web Scraper | `templates/web-scraper.mdx` | Applying the web-scraper workflow template |
|
|
99
|
+
|
|
100
|
+
## Troubleshooting
|
|
101
|
+
|
|
102
|
+
| Resource | Location | When to Load |
|
|
103
|
+
| --- | --- | --- |
|
|
104
|
+
| Common Errors | `troubleshooting/common-errors.mdx` | Debugging an unknown error not found in workspace memory |
|
package/reference/cli/index.mdx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: CLI Reference
|
|
3
3
|
description: Full reference for every elevasis CLI command -- scaffold, validate, deploy, execute, and inspect resources
|
|
4
|
+
loadWhen: "Running CLI operations"
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
The `elevasis` CLI is the primary interface for working with your Elevasis SDK project. Install it as part of `@elevasis/sdk` and use it to scaffold projects, validate resource definitions, deploy to the platform, and inspect execution history.
|
|
@@ -47,7 +48,7 @@ elevasis init my-project
|
|
|
47
48
|
```
|
|
48
49
|
Scaffolding my-project/...
|
|
49
50
|
|
|
50
|
-
Created
|
|
51
|
+
Created 23 files.
|
|
51
52
|
|
|
52
53
|
Next steps:
|
|
53
54
|
cd my-project
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Concepts Reference
|
|
3
|
+
description: Plain-English explanations of Elevasis SDK concepts -- glossary, workflow analogies, Zod schemas, execution model, platform tools, common errors, and design decisions
|
|
4
|
+
loadWhen: "User asks what is or needs conceptual grounding"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
This page covers core Elevasis concepts in plain English. It is the teaching vocabulary for the agent when helping you build workflows, and a reference you can return to whenever a term or behavior is unclear.
|
|
8
|
+
|
|
9
|
+
## Glossary
|
|
10
|
+
|
|
11
|
+
| Term | Definition |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| Workflow | A series of named steps that run one after another. Each step does one job. The workflow receives input data and produces output data. |
|
|
14
|
+
| Agent | An autonomous AI resource with access to platform tools. Agents can make decisions and call tools on their own. (Execution deferred -- see Known Limitations in the SDK overview.) |
|
|
15
|
+
| Resource | Anything you deploy to the platform -- a workflow or an agent. Each resource has a unique ID. |
|
|
16
|
+
| Step | One job inside a workflow. A step receives data, processes it, and passes data to the next step. |
|
|
17
|
+
| Schema | A description of what your data looks like. Schemas validate that input and output data has the right shape -- the right fields with the right types. |
|
|
18
|
+
| Credential | A saved API key or login for an external service (Gmail, Attio, Stripe). Stored securely on the platform, never in your code. |
|
|
19
|
+
| Execution | One run of a resource. Each time someone triggers your workflow, that is one execution. |
|
|
20
|
+
| Deployment | The act of uploading your code to the platform. After deploying, your resources are live and can be executed. |
|
|
21
|
+
| Platform Tool | A pre-built integration the platform provides. You call platform tools from your workflow steps using `platform.call()`. |
|
|
22
|
+
| Organization | Your team or company on the Elevasis platform. Resources, credentials, and executions belong to an organization. |
|
|
23
|
+
| Handler | The function inside a step that does the actual work. It receives input data and returns output data. |
|
|
24
|
+
| Entry Point | The first step that runs when a workflow is executed. Every workflow must have one. |
|
|
25
|
+
| Resource ID | A unique lowercase name for your resource (e.g., `lead-scorer`, `send-welcome-email`). Must be unique within your organization. |
|
|
26
|
+
| Workspace | Your Elevasis project directory. Contains resources (workflows and agents), documentation, and optionally a database connection and custom apps. Created by `elevasis init`. |
|
|
27
|
+
| Data Table | A table in your database (e.g., Supabase) that stores structured data your workflows can read and write. Defined in `data/schema.ts` as documentation for the agent. |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## What is a Workflow?
|
|
32
|
+
|
|
33
|
+
A workflow is a piece of automation that runs on the Elevasis platform. You define the steps in TypeScript; the platform handles running them, logging results, and retrying on failure.
|
|
34
|
+
|
|
35
|
+
### Two Analogies
|
|
36
|
+
|
|
37
|
+
**Recipe analogy:** A recipe has ingredients (input), instructions (steps), and a finished dish (output). Each instruction is one step. You follow them in order. If a step fails (you burn the sauce), the recipe stops.
|
|
38
|
+
|
|
39
|
+
**Assembly line analogy:** Raw material goes in one end (input). Each station does one job (step). The finished product comes out the other end (output).
|
|
40
|
+
|
|
41
|
+
### When to Use a Workflow
|
|
42
|
+
|
|
43
|
+
- Automating a repeatable task with defined input and output
|
|
44
|
+
- Chaining multiple actions together (fetch data, process it, send an email)
|
|
45
|
+
- When you need the platform to handle execution, retries, and logging
|
|
46
|
+
|
|
47
|
+
### When NOT to Use a Workflow
|
|
48
|
+
|
|
49
|
+
- One-off tasks you will only do once
|
|
50
|
+
- Tasks that need constant human judgment at every step
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Understanding Schemas (Zod)
|
|
55
|
+
|
|
56
|
+
### What Schemas Do
|
|
57
|
+
|
|
58
|
+
Schemas describe and validate the shape of data your workflow expects and produces. If someone sends the wrong data, the platform rejects it before your code runs. This prevents confusing errors deep inside your handler.
|
|
59
|
+
|
|
60
|
+
The Elevasis SDK uses [Zod](https://zod.dev) for schema definition. Zod is a TypeScript-first validation library. Every workflow has an `inputSchema` and an `outputSchema`.
|
|
61
|
+
|
|
62
|
+
### Common Zod Types
|
|
63
|
+
|
|
64
|
+
| Zod Type | What It Means | Example |
|
|
65
|
+
| --- | --- | --- |
|
|
66
|
+
| `z.string()` | Text | `"hello"`, `"user@email.com"` |
|
|
67
|
+
| `z.number()` | A number | `42`, `3.14` |
|
|
68
|
+
| `z.boolean()` | True or false | `true`, `false` |
|
|
69
|
+
| `z.array(z.string())` | A list of text values | `["a", "b", "c"]` |
|
|
70
|
+
| `z.object({ name: z.string() })` | A group of named fields | `{ "name": "Jane" }` |
|
|
71
|
+
| `z.string().optional()` | Text that might be missing | `"hello"` or not provided |
|
|
72
|
+
| `z.enum(['a', 'b', 'c'])` | One of a specific set of values | `"a"` |
|
|
73
|
+
| `z.string().email()` | Text that must be a valid email | `"user@example.com"` |
|
|
74
|
+
|
|
75
|
+
### Why `z.infer` Exists
|
|
76
|
+
|
|
77
|
+
`z.infer` creates a TypeScript type from a schema so the type system can check your code. You define the schema once and get both runtime validation and compile-time checking. Without it, you would have to define the same shape twice -- once as a Zod schema and once as a TypeScript type.
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
const myInput = z.object({ name: z.string(), age: z.number() });
|
|
81
|
+
type MyInput = z.infer<typeof myInput>;
|
|
82
|
+
// MyInput is now: { name: string; age: number }
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Common Schema Mistakes
|
|
86
|
+
|
|
87
|
+
- Forgetting `.optional()` on fields that might be missing -- the platform will reject valid input that omits those fields
|
|
88
|
+
- Returning data from a handler that does not match the output schema -- causes `outputSchema validation failed`
|
|
89
|
+
- Misspelling field names -- the schema says `companyName`, but the handler returns `company_name`
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## The Execution Model
|
|
94
|
+
|
|
95
|
+
### What Happens When You Run a Workflow
|
|
96
|
+
|
|
97
|
+
1. A request arrives at the Elevasis platform (someone runs `elevasis exec` or a schedule triggers)
|
|
98
|
+
2. The platform creates a temporary server just for this execution
|
|
99
|
+
3. Your code runs on that server
|
|
100
|
+
4. The result is sent back
|
|
101
|
+
5. The temporary server is deleted
|
|
102
|
+
|
|
103
|
+
### Practical Implications
|
|
104
|
+
|
|
105
|
+
| What You Might Expect | What Actually Happens | Why |
|
|
106
|
+
| --- | --- | --- |
|
|
107
|
+
| Files I create persist | Files disappear after execution | The server is temporary |
|
|
108
|
+
| I can see logs in real-time | Logs appear after execution completes | No streaming from workers |
|
|
109
|
+
| My code runs on my computer | Your code runs on Elevasis servers | That is what "deploy" means |
|
|
110
|
+
| I can use unlimited memory | 256MB memory limit per execution | Prevents runaway processes |
|
|
111
|
+
| Executions share state | Each execution is independent | No shared memory between runs |
|
|
112
|
+
| I can call external APIs | Yes, outbound network is unrestricted | Workers have internet access |
|
|
113
|
+
|
|
114
|
+
### What "completed" vs "failed" Means
|
|
115
|
+
|
|
116
|
+
- **completed** -- Your code ran successfully and returned output
|
|
117
|
+
- **failed** -- Something went wrong: your code threw an error, timed out (300s default), or ran out of memory
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Platform Tools Overview
|
|
122
|
+
|
|
123
|
+
Platform tools are pre-built integrations the platform provides. You call them from inside workflow steps using `platform.call()` without managing API keys in your code.
|
|
124
|
+
|
|
125
|
+
### Tool Categories
|
|
126
|
+
|
|
127
|
+
| Category | Tools | Example Use |
|
|
128
|
+
| --- | --- | --- |
|
|
129
|
+
| Communication | Gmail, Resend, email | Send transactional emails, notifications |
|
|
130
|
+
| CRM | Attio (11 methods) | Create leads, update records, search contacts |
|
|
131
|
+
| Documents | PDF, Google Sheets, Notion | Generate invoices, read spreadsheets, update pages |
|
|
132
|
+
| AI | LLM (GPT, Gemini, Claude) | Classify text, extract data, generate content |
|
|
133
|
+
| Storage | Dropbox, platform storage | Upload files, create signed URLs |
|
|
134
|
+
| Scheduling | Scheduler | Run workflows on a schedule or after a delay |
|
|
135
|
+
| Approvals | Approval gates | Pause workflow until a human approves |
|
|
136
|
+
| Verification | Mailso | Verify email addresses |
|
|
137
|
+
| E-Signatures | SignatureAPI | Create and manage document envelopes |
|
|
138
|
+
| Marketing | Instantly | Send email campaigns |
|
|
139
|
+
| Payments | Stripe | Create payment links, checkout sessions |
|
|
140
|
+
| Automation | Apify | Run web scraping actors |
|
|
141
|
+
|
|
142
|
+
### How Credentials Work
|
|
143
|
+
|
|
144
|
+
1. Create a credential in the Elevasis platform (API key, OAuth token, etc.) via the command center UI
|
|
145
|
+
2. Give it a name (e.g., `my-gmail`, `production-attio`)
|
|
146
|
+
3. In your code, pass that name: `platform.call({ credential: 'my-gmail', ... })`
|
|
147
|
+
4. The platform injects the actual API key at runtime -- it never appears in your code
|
|
148
|
+
|
|
149
|
+
### What Happens When a Credential Name is Wrong
|
|
150
|
+
|
|
151
|
+
You will see a `PlatformToolError` with the message "credential not found". Check for typos -- credential names are case-sensitive.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Common Errors and Fixes
|
|
156
|
+
|
|
157
|
+
| Error | What It Means | How to Fix |
|
|
158
|
+
| --- | --- | --- |
|
|
159
|
+
| `ELEVASIS_API_KEY not set` | Your `.env` file is missing the API key | Add `ELEVASIS_API_KEY=sk_...` to `.env` |
|
|
160
|
+
| `Schema validation failed` | The input data does not match your Zod schema | Compare the error's field names to your schema definition. Check types (string vs number) and required vs optional fields. |
|
|
161
|
+
| `Cannot find module '@elevasis/sdk'` | Dependencies are not installed | Run `pnpm install` |
|
|
162
|
+
| `PlatformToolError: credential not found` | The credential name in your code does not match any stored credential | Check spelling and case. Verify the credential name in the command center UI. |
|
|
163
|
+
| `Execution timeout (300s)` | Your workflow took too long | Optimize your handler or break it into smaller steps. Check for infinite loops. |
|
|
164
|
+
| `Cannot find name 'z'` | Missing Zod import | Add `import { z } from 'zod'` at the top of your file |
|
|
165
|
+
| `Type 'X' is not assignable to type 'Y'` | Your handler returns data that does not match the output schema | Compare what your handler returns to what `outputSchema` expects. Field names and types must match exactly. |
|
|
166
|
+
| `outputSchema validation failed` | Handler returned data but it does not match the output schema | Check field names, types, and required fields against your output schema. |
|
|
167
|
+
| `Duplicate resource ID` | Two resources have the same `resourceId` | Each resource needs a unique ID within your organization. Rename one. |
|
|
168
|
+
| `NODE_ENV=development` in .env | SDK is trying to connect to a local API server | Remove `NODE_ENV` from your `.env` file. The SDK connects to the hosted platform by default. |
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Design Decisions Guide
|
|
173
|
+
|
|
174
|
+
### Single-Step vs Multi-Step
|
|
175
|
+
|
|
176
|
+
Use a single step when the workflow does one thing -- validate an email, format a message, call one API.
|
|
177
|
+
|
|
178
|
+
Use multiple steps when you have distinct phases (fetch data, process it, send a notification) or when you want separate error handling per phase. Each step failure is logged independently, making it easier to identify where something went wrong.
|
|
179
|
+
|
|
180
|
+
### dev vs production Status
|
|
181
|
+
|
|
182
|
+
- **dev** -- Resource is visible in the dashboard and can be triggered manually, but will not auto-trigger from schedules or webhooks. Use while building and testing.
|
|
183
|
+
- **production** -- Resource is fully live. All trigger sources work. Use when you are confident it works correctly.
|
|
184
|
+
|
|
185
|
+
You can switch between them by changing `status` in the workflow config and redeploying.
|
|
186
|
+
|
|
187
|
+
### When to Use Conditional Routing
|
|
188
|
+
|
|
189
|
+
Use `StepType.CONDITIONAL` when different inputs should follow different processing paths.
|
|
190
|
+
|
|
191
|
+
Example: score >= 80 goes to the approve path, score >= 50 goes to the review path, everything else goes to the reject path. Each path can have its own steps and logic.
|
|
192
|
+
|
|
193
|
+
Always include a `defaultTarget` fallback for inputs that do not match any condition. Without a fallback, an unmatched execution will fail.
|
|
194
|
+
|
|
195
|
+
### When to Use Platform Tools vs Custom Code
|
|
196
|
+
|
|
197
|
+
Use platform tools when the integration exists in the tool catalog -- they handle auth, retries, and error normalization for you.
|
|
198
|
+
|
|
199
|
+
Write custom code (e.g., using `fetch` directly) only when you need a service or API method that is not in the catalog, or when you need fine-grained control over the HTTP request.
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
**Last Updated:** 2026-02-26
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Execution API
|
|
3
3
|
description: REST endpoints for executing resources, querying execution history, and managing deployments via the Elevasis external API
|
|
4
|
+
loadWhen: "Calling the API directly or debugging API responses"
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
The Elevasis external API exposes REST endpoints under `/api/external/` for executing your deployed resources and inspecting results. All endpoints require your `ELEVASIS_API_KEY` sent as a Bearer token. Organization is resolved server-side from the API key -- you never pass an org identifier in requests.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Deploying Resources
|
|
3
3
|
description: How to deploy your Elevasis SDK resources to the platform using elevasis deploy, including configuration, validation, and environment setup
|
|
4
|
+
loadWhen: "Preparing to deploy or debugging deploy failures"
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
Deploying your resources makes them live on the Elevasis platform and immediately available for execution. The deploy process validates your resource definitions, bundles your code into a single self-contained file, and uploads it to the platform -- no server-side dependency installation required.
|