lindy-sdk-patterns

Lindy AI integration patterns for webhook handling, HTTP actions, and Run Code. Use when building integrations, calling Lindy agents from code, or implementing the Run Code action with Python/JavaScript. Trigger with phrases like "lindy SDK patterns", "lindy best practices", "lindy API patterns", "lindy Run Code", "lindy HTTP Request".

1,868 stars

Best use case

lindy-sdk-patterns is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Lindy AI integration patterns for webhook handling, HTTP actions, and Run Code. Use when building integrations, calling Lindy agents from code, or implementing the Run Code action with Python/JavaScript. Trigger with phrases like "lindy SDK patterns", "lindy best practices", "lindy API patterns", "lindy Run Code", "lindy HTTP Request".

Teams using lindy-sdk-patterns should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/lindy-sdk-patterns/SKILL.md --create-dirs "https://raw.githubusercontent.com/jeremylongshore/claude-code-plugins-plus-skills/main/plugins/saas-packs/lindy-pack/skills/lindy-sdk-patterns/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/lindy-sdk-patterns/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How lindy-sdk-patterns Compares

Feature / Agentlindy-sdk-patternsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Lindy AI integration patterns for webhook handling, HTTP actions, and Run Code. Use when building integrations, calling Lindy agents from code, or implementing the Run Code action with Python/JavaScript. Trigger with phrases like "lindy SDK patterns", "lindy best practices", "lindy API patterns", "lindy Run Code", "lindy HTTP Request".

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Lindy SDK & Integration Patterns

## Overview
Lindy is primarily a no-code platform. External integration happens through three
channels: **Webhook triggers** (inbound), **HTTP Request actions** (outbound), and
**Run Code actions** (inline Python/JS execution via E2B sandbox). This skill covers
patterns for each.

## Prerequisites
- Lindy account with active agents
- Node.js 18+ or Python 3.10+ for webhook receivers
- Completed `lindy-install-auth` setup

## Pattern 1: Webhook Trigger Integration
Your application fires webhooks to wake Lindy agents:

```typescript
// lindy-client.ts — Reusable Lindy webhook trigger client
class LindyClient {
  private webhookUrl: string;
  private secret: string;

  constructor(webhookUrl: string, secret: string) {
    this.webhookUrl = webhookUrl;
    this.secret = secret;
  }

  async trigger(payload: Record<string, unknown>): Promise<{ status: number }> {
    const response = await fetch(this.webhookUrl, {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${this.secret}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify(payload),
    });

    if (!response.ok) {
      throw new Error(`Lindy webhook failed: ${response.status} ${response.statusText}`);
    }

    return { status: response.status };
  }

  async triggerWithCallback(
    payload: Record<string, unknown>,
    callbackUrl: string
  ): Promise<{ status: number }> {
    return this.trigger({ ...payload, callbackUrl });
  }
}

// Usage
const lindy = new LindyClient(
  'https://public.lindy.ai/api/v1/webhooks/YOUR_ID',
  process.env.LINDY_WEBHOOK_SECRET!
);

await lindy.trigger({ event: 'lead.created', name: 'Jane Doe', email: 'jane@co.com' });
```

## Pattern 2: HTTP Request Action (Agent Calling Your API)
Configure a Lindy agent to call your API as an action step:

**In Lindy Dashboard** — Add HTTP Request action:
- **Method**: POST
- **URL**: `https://api.yourapp.com/process`
- **Headers**: `Authorization: Bearer {{your_api_key}}`, `Content-Type: application/json`
- **Body** (AI Prompt mode):
  ```
  Send the processed data as JSON with fields matching the API schema.
  Include: name from {{trigger.data.name}}, analysis from previous step.
  ```

**Your API endpoint** receives the call:
```typescript
// Your API receiving Lindy agent calls
app.post('/process', async (req, res) => {
  const { name, analysis } = req.body;
  const result = await processData(name, analysis);
  res.json({ result, processedAt: new Date().toISOString() });
});
```

## Pattern 3: Run Code Action (E2B Sandbox)
Execute Python or JavaScript directly in Lindy workflows. Code runs in isolated
Firecracker microVMs with ~150ms startup time.

**Python example** (data transformation in a workflow):
```python
# Run Code action — Python
# Input variables: raw_data (string from previous step)
import json

data = json.loads(raw_data)  # Input vars are always strings

# Process
cleaned = [
    {"name": item["name"].strip(), "score": float(item["score"])}
    for item in data["items"]
    if float(item["score"]) > 0.5
]

# Sort by score descending
cleaned.sort(key=lambda x: x["score"], reverse=True)

# Return value accessible as {{run_code.result}} in next step
return json.dumps({"filtered_count": len(cleaned), "items": cleaned})
```

**JavaScript example** (API call + processing):
```javascript
// Run Code action — JavaScript
// Input variables: query (string), api_key (string)
const response = await fetch(`https://api.example.com/search?q=${query}`, {
  headers: { 'Authorization': `Bearer ${api_key}` }
});
const data = await response.json();

const summary = data.results.map(r => `${r.title}: ${r.snippet}`).join('\n');
return JSON.stringify({ count: data.results.length, summary });
```

**Run Code outputs** (available to subsequent steps):
| Output | Contents |
|--------|----------|
| `{{run_code.result}}` | Value from `return` statement |
| `{{run_code.text}}` | stdout from `print()` / `console.log()` |
| `{{run_code.stderr}}` | Error output for debugging |

**Available Python libraries**: pandas, numpy, scipy, scikit-learn, matplotlib,
requests, aiohttp, beautifulsoup4, nltk, spacy, openpyxl, python-docx

**Key constraint**: All input variables arrive as strings. Cast explicitly:
`count = int(count_str)`, `data = json.loads(json_str)`

## Pattern 4: Callback Pattern (Async Two-Way)
Send a `callbackUrl` in your webhook payload. Lindy can respond back using
the **Send POST Request to Callback** action:

```typescript
// Your app triggers Lindy with a callback URL
await lindy.trigger({
  event: 'analyze.request',
  data: { text: 'Analyze this quarterly report...' },
  callbackUrl: 'https://api.yourapp.com/lindy-callback'
});

// Your callback handler receives Lindy's response
app.post('/lindy-callback', (req, res) => {
  const { analysis, sentiment, summary } = req.body;
  saveAnalysis(analysis);
  res.sendStatus(200);
});
```

## Pattern 5: Retry with Exponential Backoff
```typescript
async function triggerWithRetry(
  client: LindyClient,
  payload: Record<string, unknown>,
  maxRetries = 3
): Promise<void> {
  for (let attempt = 0; attempt <= maxRetries; attempt++) {
    try {
      await client.trigger(payload);
      return;
    } catch (error: any) {
      if (attempt === maxRetries) throw error;
      const delay = Math.pow(2, attempt) * 1000; // 1s, 2s, 4s
      console.warn(`Retry ${attempt + 1}/${maxRetries} in ${delay}ms`);
      await new Promise(r => setTimeout(r, delay));
    }
  }
}
```

## Error Handling

| Pattern | Failure Mode | Solution |
|---------|-------------|----------|
| Webhook trigger | 401 Unauthorized | Verify Bearer token matches dashboard secret |
| HTTP Request action | Target API unreachable | Check URL, verify HTTPS, test with curl |
| Run Code | Timeout | Avoid infinite loops; keep execution under 30s |
| Run Code | Import error | Use only pre-installed libraries (see list above) |
| Callback | Callback URL unreachable | Ensure HTTPS endpoint is publicly accessible |

## Resources
- [Calling Any API](https://www.lindy.ai/academy-lessons/calling-any-api)
- [Run Code Documentation](https://docs.lindy.ai/skills/by-lindy/run-code)
- [Webhooks Documentation](https://docs.lindy.ai/skills/by-lindy/webhooks)

## Next Steps
Proceed to `lindy-core-workflow-a` for full agent creation workflows.

Related Skills

workhuman-sdk-patterns

1868
from jeremylongshore/claude-code-plugins-plus-skills

Workhuman sdk patterns for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman sdk patterns".

wispr-sdk-patterns

1868
from jeremylongshore/claude-code-plugins-plus-skills

Wispr Flow sdk patterns for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr sdk patterns".

windsurf-sdk-patterns

1868
from jeremylongshore/claude-code-plugins-plus-skills

Apply production-ready Windsurf workspace configuration and Cascade interaction patterns. Use when configuring .windsurfrules, workspace rules, MCP servers, or establishing team coding standards for Windsurf AI. Trigger with phrases like "windsurf patterns", "windsurf best practices", "windsurf config patterns", "windsurfrules", "windsurf workspace".

windsurf-reliability-patterns

1868
from jeremylongshore/claude-code-plugins-plus-skills

Implement reliable Cascade workflows with checkpoints, rollback, and incremental editing. Use when building fault-tolerant AI coding workflows, preventing Cascade from breaking builds, or establishing safe practices for multi-file AI edits. Trigger with phrases like "windsurf reliability", "cascade safety", "windsurf rollback", "cascade checkpoint", "safe cascade workflow".

webflow-sdk-patterns

1868
from jeremylongshore/claude-code-plugins-plus-skills

Apply production-ready Webflow SDK patterns — singleton client, typed error handling, pagination helpers, and raw response access for the webflow-api package. Use when implementing Webflow integrations, refactoring SDK usage, or establishing team coding standards. Trigger with phrases like "webflow SDK patterns", "webflow best practices", "webflow code patterns", "idiomatic webflow", "webflow typescript".

vercel-sdk-patterns

1868
from jeremylongshore/claude-code-plugins-plus-skills

Production-ready Vercel REST API patterns with typed fetch wrappers and error handling. Use when integrating with the Vercel API programmatically, building deployment tools, or establishing team coding standards for Vercel API calls. Trigger with phrases like "vercel SDK patterns", "vercel API wrapper", "vercel REST API client", "vercel best practices", "idiomatic vercel API".

vercel-reliability-patterns

1868
from jeremylongshore/claude-code-plugins-plus-skills

Implement reliability patterns for Vercel deployments including circuit breakers, retry logic, and graceful degradation. Use when building fault-tolerant serverless functions, implementing retry strategies, or adding resilience to production Vercel services. Trigger with phrases like "vercel reliability", "vercel circuit breaker", "vercel resilience", "vercel fallback", "vercel graceful degradation".

veeva-sdk-patterns

1868
from jeremylongshore/claude-code-plugins-plus-skills

Veeva Vault sdk patterns for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva sdk patterns".

vastai-sdk-patterns

1868
from jeremylongshore/claude-code-plugins-plus-skills

Apply production-ready Vast.ai SDK patterns for Python and REST API. Use when implementing Vast.ai integrations, refactoring SDK usage, or establishing coding standards for GPU cloud operations. Trigger with phrases like "vastai SDK patterns", "vastai best practices", "vastai code patterns", "idiomatic vastai".

twinmind-sdk-patterns

1868
from jeremylongshore/claude-code-plugins-plus-skills

Apply production-ready TwinMind SDK patterns for TypeScript and Python. Use when implementing TwinMind integrations, refactoring API usage, or establishing team coding standards for meeting AI integration. Trigger with phrases like "twinmind SDK patterns", "twinmind best practices", "twinmind code patterns", "idiomatic twinmind".

together-sdk-patterns

1868
from jeremylongshore/claude-code-plugins-plus-skills

Together AI sdk patterns for inference, fine-tuning, and model deployment. Use when working with Together AI's OpenAI-compatible API. Trigger: "together sdk patterns".

techsmith-sdk-patterns

1868
from jeremylongshore/claude-code-plugins-plus-skills

TechSmith sdk patterns for Snagit COM API and Camtasia automation. Use when working with TechSmith screen capture and video editing automation. Trigger: "techsmith sdk patterns".