Skip to content
lindy-sdk-patterns logo

Lindy SDK & Integration Patterns

lindy-sdk-patterns

Lindy AI integration patterns for webhook handling, HTTP actions, and

SKILL.md

Full skill instructions

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.

More skills from jeremylongshore

openrouter-compliance-review logo
jeremylongshore/claude-code-plugins-plus-skills

openrouter-compliance-review

Review OpenRouter integration for regulatory compliance (SOC2, GDPR,

2.8K 0
View
maintainx-data-handling logo
jeremylongshore/claude-code-plugins-plus-skills

maintainx-data-handling

Data synchronization, ETL patterns, and data management for MaintainX.

2.8K 0
View
groq-core-workflow-a logo
jeremylongshore/claude-code-plugins-plus-skills

groq-core-workflow-a

Execute Groq primary workflow: chat completions with tool use and JSON

2.8K 0
View
validating-csrf-protection logo
jeremylongshore/claude-code-plugins-plus-skills

validating-csrf-protection

Validate CSRF protection implementations for security gaps. Use when

2.8K 0
View
api-contract logo
jeremylongshore/claude-code-plugins-plus-skills

api-contract

Configure this skill should be used when the user asks about "API contract",

2.8K 0
View
ideogram-incident-runbook logo
jeremylongshore/claude-code-plugins-plus-skills

ideogram-incident-runbook

Execute Ideogram incident response with triage, mitigation, and postmortem.

2.8K 0
View
gamma-sdk-patterns logo
jeremylongshore/claude-code-plugins-plus-skills

gamma-sdk-patterns

Reusable patterns for the Gamma REST API (no SDK exists).

2.8K 0
View
deepgram-sdk-patterns logo
jeremylongshore/claude-code-plugins-plus-skills

deepgram-sdk-patterns

Apply production-ready Deepgram SDK patterns for TypeScript and Python.

2.8K 0
View
openrouter-upgrade-migration logo
jeremylongshore/claude-code-plugins-plus-skills

openrouter-upgrade-migration

Migrate to OpenRouter from direct provider APIs or upgrade between SDK/model

2.8K 0
View
openrouter-common-errors logo
jeremylongshore/claude-code-plugins-plus-skills

openrouter-common-errors

Diagnose and fix common OpenRouter API errors. Use when encountering

2.8K 0
View
linear-cost-tuning logo
jeremylongshore/claude-code-plugins-plus-skills

linear-cost-tuning

Optimize Linear API usage, reduce unnecessary calls, and maximize

2.8K 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View