A Cursor-powered repository for rapid development of Deco tools and workflows with just-in-time validation.
Deco Cursor is your ultimate companion for building, testing, and deploying automation workflows and tools directly from your IDE. It bridges the gap between your local development environment and your Deco workspace with seamless synchronization and real-time validation.
- π― Just-In-Time Validation - Instantly validate tools and workflows before deployment
- π Auto-Sync - Changes are automatically pushed to your workspace while you work
- π οΈ Tool Discovery - Built-in scripts to explore and catalog all available tools in your workspace
- π Workflow Orchestration - Create complex multi-step workflows with integrated debugging
- π§ AI-Powered - Leverage Deco's AI generation tools to create intelligent automations
- π» Cursor Integration - Perfect for use with Cursor AI editor for optimal developer experience
git clone <repository-url>
cd deco-cursorThis is the most important step! Many users make mistakes here.
# β DO NOT use deco whoami to find your workspace
# It shows your PERSONAL workspace, which is usually NOT what you want
# β
INSTEAD, find your workspace from the Deco Chat URL:
# 1. Go to https://chat.deco.cx
# 2. Look at the URL bar
# 3. It shows: chat.deco.cx/YOUR-WORKSPACE-HERE
# 4. Copy that path exactly
# Examples of correct workspace paths:
/company/default # β
Company project workspace
/team-name/production # β
Team workspace
/users/abc-123-def-456 # β Personal workspace (usually NOT for projects!)Question: What workspace are you developing for?
- πΌ A company/organization? β Use their workspace (e.g.,
/company/default) - π₯ A team? β Use team workspace (e.g.,
/myteam/production) - π§ͺ Just experimenting? β Use your personal workspace (e.g.,
/users/your-id)
Replace /my-workspace/default with your actual Deco workspace path (from step 2):
deco deconfig pull -w /my-workspace/default --path deconfigThis downloads your workspace's tools, views, and workflows to the deconfig directory.
BEFORE running this, verify one more time that the workspace path is correct!
Keep your changes synchronized with your Deco workspace in real-time:
# β οΈ TRIPLE CHECK: Is /my-workspace/default correct?
# Don't use deco whoami - use the path from https://chat.deco.cx
deco deconfig push -w /my-workspace/default --path deconfig --watchImportant: Leave this command running in a terminal window while you develop. The --watch flag automatically uploads changes whenever you save files.
Now all your changes will be:
- β Automatically sent to your workspace
- β Instantly available in your Deco environment
- β Version controlled in this repository
deco-cursor/
βββ README.md # This file
βββ currentWorkspace.json # Your workspace configuration
βββ available-tools.json # Catalog of available tools (generated)
β
βββ scripts/ # Utility scripts for tool discovery
β βββ setup.ts # Initial setup wizard
β βββ generate-available-tools.ts # Generate tool catalog
β βββ list-tools.ts # List all available tools
β βββ find-tool.ts # Find specific tool with details
β βββ search-tools.ts # Search tools by keyword
β βββ config.ts # Shared configuration module
β βββ README.md # Scripts documentation
β βββ QUICK-REFERENCE.md # Quick reference guide
β
βββ tmp/ # Temporary files (gitignored)
β βββ *.json # Workflow results and debugging data
β
βββ workflows/ # Your workflows
βββ (created as you develop)
Before creating workflows, discover what tools are available in your workspace:
deno run --allow-all scripts/generate-available-tools.ts
deno run --allow-all scripts/list-tools.tsThis generates available-tools.json with a complete catalog.
# Search for AI-related tools
deno run --allow-all scripts/search-tools.ts "AI"
# Search for database tools
deno run --allow-all scripts/search-tools.ts "database"
# Get full details of a specific tool
deno run --allow-all scripts/find-tool.ts "AI_GENERATE_OBJECT"The scripts output includes:
- Tool name and description
- Input schema (what parameters it accepts)
- Output schema (what it returns)
- Integration ID (needed for workflow execution)
Ready to create a workflow? Ask Cursor to build one for you!
Here's an example prompt you can use:
Prompt for Cursor:
Create a new Deco workflow called
generate-city-poemthat:
- Takes a
cityNameas input (string)- Uses the AI generation tool to create a poem about that city
- Returns the poem as output
The workflow should use the AI_GENERATE_OBJECT tool from the AI Gateway integration to generate a structured response with a poem field. Make sure to include proper error handling and match the output schema correctly.
When you ask Cursor, it will:
- Discover available tools using the scripts
- Create the workflow step by step
- Test each step individually
- Generate the complete workflow file
# After the workflow is created and synced:
deco call-tool -w /my-workspace/default \
-i i:workflows-management \
DECO_WORKFLOW_START \
-p '{
"uri": "rsc://workflow/generate-city-poem",
"input": {
"cityName": "Paris"
}
}'This will return a poem about Paris generated by AI!
The repository includes comprehensive guides for workflow creation:
scripts/README.md- Complete tools discovery guidescripts/QUICK-REFERENCE.md- Quick command referencescripts/INSTALL.md- Detailed installation guide
Each workflow consists of steps that execute sequentially:
// Each step is an async function that:
// 1. Receives input (with @refs resolved to actual values)
// 2. Can call tools via ctx.env
// 3. Returns output for next steps
export default async function(input, ctx) {
const result = await ctx.env['i:ai-generation'].AI_GENERATE_OBJECT({
schema: { /* ... */ },
messages: [ /* ... */ ]
});
return {
poem: result.object?.poem || '',
error: null
};
}Use @refs to pass data between steps:
{
"name": "step-2",
"input": {
"poem": "@step-1.poem",
"cityName": "@step-1.cityName"
}
}Always include try/catch and return all output schema properties:
try {
const result = await /* tool call */;
return { poem: result.object?.poem || '' };
} catch (error) {
return {
poem: '',
error: String(error)
};
}deno run --allow-all scripts/search-tools.ts "keyword"
deno run --allow-all scripts/find-tool.ts "TOOL_NAME""Create a workflow that uses [TOOL_NAME] to do [TASK]"
deco deconfig push -w /my-workspace/default --path deconfig --watchdeco call-tool -w /my-workspace/default \
-i i:workflows-management \
DECO_WORKFLOW_START \
-p '{"uri": "rsc://workflow/my-workflow", "input": {...}}'deco call-tool -w /my-workspace/default \
-i i:workflows-management \
DECO_RESOURCE_WORKFLOW_RUN_READ \
-p '{"uri": "rsc://i:workflows-management/workflow_run/{runId}"}'Create a workflow that transforms input through multiple steps:
// Step 1: Fetch data
// Step 2: Transform/filter
// Step 3: Enrich with AI
// Step 4: Return formatted resultValidate data at each step before proceeding:
export default async function(input, ctx) {
if (!input.data) {
return { valid: false, error: 'Missing data' };
}
// Process...
return { valid: true, result };
}Use stopAfter for debugging specific steps:
# Run only up to step 2 for debugging
deco call-tool -w /workspace \
-i i:workflows-management \
DECO_WORKFLOW_START \
-p '{
"uri": "rsc://workflow/my-workflow",
"input": {...},
"stopAfter": "step-2"
}'The repository includes a tmp/ directory for storing intermediate results:
// Save results in your scripts
const results = { /* your data */ };
await Deno.writeTextFile(
'./tmp/workflow-results.json',
JSON.stringify(results, null, 2)
);Use these for:
- β Debugging failed workflows
- β Tracking execution history
- β Sharing results with team
- β Building reports
Always keep deco deconfig push --watch running during development:
- Your changes won't be uploaded without it
- Open it in a separate terminal window
- The process watches for file changes automatically
Make sure you use the correct workspace path:
- β Don't use personal workspace:
/users/your-id - β
Use project/team workspace:
/company/defaultor/team/production
Don't manually edit these files (they're generated):
available-tools.json- Regenerate with scripts- Files in
tmp/- Temporary, safe to delete
# Create currentWorkspace.json if it doesn't exist
deno run --allow-all scripts/setup.ts# List all available integrations
deco call-tool -w /my-workspace/default \
-i i:integration-management \
INTEGRATIONS_LIST | jq '.items[] | {id, name}'# Make sure push --watch is running
# Check the terminal where you ran the command
# Restart it if needed:
deco deconfig push -w /my-workspace/default --path deconfig --watch# Check the workflow run status
deco call-tool -w /my-workspace/default \
-i i:workflows-management \
DECO_RESOURCE_WORKFLOW_RUN_READ \
-p '{"uri": "rsc://i:workflows-management/workflow_run/{runId}"}'- β Clone and setup this repository
- β
Run
deco deconfig pullto download your workspace - β
Start
deco deconfig push --watchin a terminal - β Ask Cursor to create your first workflow
- β Test and iterate with auto-sync enabled
- β Explore other tools with the discovery scripts
- β Build complex workflows by chaining multiple steps
- π Tool Discovery: See
scripts/README.mdandscripts/QUICK-REFERENCE.md - π οΈ Workflow Guides: Check the rules section at the top of this guide
- π¬ Ask Cursor: Use natural language to request workflow creation
- π Deco Docs: Visit docs.deco.cx
- Use Cursor AI: Ask Cursor to create workflows, test them, and iterate
- Keep Scripts Handy: Tool discovery scripts are your best friends
- Test Incrementally: Test each step before creating the full workflow
- Save Results: Store workflow outputs in
tmp/for debugging - Read Tool Schemas: Understanding input/output schemas is key to success
- Error Handling: Always include try/catch blocks in workflow steps
- Use jq: Process JSON outputs with jq for better visibility
This repository is part of the Deco ecosystem and follows the same licensing terms.
Happy coding! π Build amazing workflows with Deco and Cursor.