lindy-sdk-patterns

4
1
Source

Lindy AI SDK best practices and common patterns. Use when learning SDK patterns, optimizing API usage, or implementing advanced agent features. Trigger with phrases like "lindy SDK patterns", "lindy best practices", "lindy API patterns", "lindy code patterns".

Install

mkdir -p .claude/skills/lindy-sdk-patterns && curl -L -o skill.zip "https://mcp.directory/api/skills/download/3066" && unzip -o skill.zip -d .claude/skills/lindy-sdk-patterns && rm skill.zip

Installs to .claude/skills/lindy-sdk-patterns

About this skill

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:

// 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: '[email protected]' });

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:

// 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):

# 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):

// 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):

OutputContents
{{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:

// 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

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

PatternFailure ModeSolution
Webhook trigger401 UnauthorizedVerify Bearer token matches dashboard secret
HTTP Request actionTarget API unreachableCheck URL, verify HTTPS, test with curl
Run CodeTimeoutAvoid infinite loops; keep execution under 30s
Run CodeImport errorUse only pre-installed libraries (see list above)
CallbackCallback URL unreachableEnsure HTTPS endpoint is publicly accessible

Resources

Next Steps

Proceed to lindy-core-workflow-a for full agent creation workflows.

svg-icon-generator

jeremylongshore

Svg Icon Generator - Auto-activating skill for Visual Content. Triggers on: svg icon generator, svg icon generator Part of the Visual Content skill category.

10735

d2-diagram-creator

jeremylongshore

D2 Diagram Creator - Auto-activating skill for Visual Content. Triggers on: d2 diagram creator, d2 diagram creator Part of the Visual Content skill category.

9033

automating-mobile-app-testing

jeremylongshore

This skill enables automated testing of mobile applications on iOS and Android platforms using frameworks like Appium, Detox, XCUITest, and Espresso. It generates end-to-end tests, sets up page object models, and handles platform-specific elements. Use this skill when the user requests mobile app testing, test automation for iOS or Android, or needs assistance with setting up device farms and simulators. The skill is triggered by terms like "mobile testing", "appium", "detox", "xcuitest", "espresso", "android test", "ios test".

18728

performing-penetration-testing

jeremylongshore

This skill enables automated penetration testing of web applications. It uses the penetration-tester plugin to identify vulnerabilities, including OWASP Top 10 threats, and suggests exploitation techniques. Use this skill when the user requests a "penetration test", "pentest", "vulnerability assessment", or asks to "exploit" a web application. It provides comprehensive reporting on identified security flaws.

5519

designing-database-schemas

jeremylongshore

Design and visualize efficient database schemas, normalize data, map relationships, and generate ERD diagrams and SQL statements.

12516

optimizing-sql-queries

jeremylongshore

This skill analyzes and optimizes SQL queries for improved performance. It identifies potential bottlenecks, suggests optimal indexes, and proposes query rewrites. Use this when the user mentions "optimize SQL query", "improve SQL performance", "SQL query optimization", "slow SQL query", or asks for help with "SQL indexing". The skill helps enhance database efficiency by analyzing query structure, recommending indexes, and reviewing execution plans.

5513

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

1,6811,428

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

1,2591,319

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

1,5271,144

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

1,349807

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

1,261727

pdf-to-markdown

aliceisjustplaying

Convert entire PDF documents to clean, structured Markdown for full context loading. Use this skill when the user wants to extract ALL text from a PDF into context (not grep/search), when discussing or analyzing PDF content in full, when the user mentions "load the whole PDF", "bring the PDF into context", "read the entire PDF", or when partial extraction/grepping would miss important context. This is the preferred method for PDF text extraction over page-by-page or grep approaches.

1,466674