Skip to main content

Workflows

Build and deploy automated pipelines with the Case.dev Visual Workflow Builder. Workflows run on Relay—our serverless execution engine that scales from zero to millions of executions.

Overview

Workflows chain Case.dev services (Vaults, LLMs, OCR, Search, Voice, Format) into automated pipelines:
  • Visual Builder — Drag and drop nodes at workflow.case.dev
  • Webhook Triggers — Every workflow gets a unique webhook URL
  • Serverless Execution — Pay only for what you use, automatic scaling
  • Full Observability — Monitor every execution with detailed logs

Quick Start

  1. Open workflow.case.dev
  2. Drag action nodes onto the canvas
  3. Connect nodes with edges
  4. Configure each node’s settings
  5. Click Deploy to get your webhook URL

Option 2: API-First (Programmatic)

Create and deploy a workflow in a single API call:
curl -X POST https://api.case.dev/workflows/v1/create \
  -H "Authorization: Bearer $CASEDEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Document Summary Pipeline",
    "description": "Search and summarize documents",
    "nodes": [
      {
        "id": "trigger-1",
        "type": "trigger",
        "label": "Webhook Trigger",
        "config": { "triggerType": "Webhook" }
      },
      {
        "id": "search-1",
        "type": "action",
        "label": "Search Web",
        "config": {
          "actionType": "case-search/web-search",
          "query": "{{topic}}"
        }
      },
      {
        "id": "llm-1",
        "type": "action",
        "label": "Summarize",
        "config": {
          "actionType": "case-llm/llm",
          "method": "chat",
          "model": "gpt-4o",
          "systemPrompt": "Summarize the search results concisely.",
          "userPrompt": "{{results.Search_Web.output.results}}"
        }
      }
    ],
    "edges": [
      { "source": "trigger-1", "target": "search-1" },
      { "source": "search-1", "target": "llm-1" }
    ]
  }'
Response:
{
  "id": "wf_abc123",
  "name": "Document Summary Pipeline",
  "webhookUrl": "https://api.case.dev/workflows/v1/wf_abc123/webhook",
  "webhookSecret": "whsec_...",
  "status": "deployed"
}
Important: Save your webhookSecret—it won’t be shown again.

Execute Your Workflow

curl -X POST "https://api.case.dev/workflows/v1/wf_abc123/webhook" \
  -H "X-Webhook-Secret: whsec_..." \
  -H "Content-Type: application/json" \
  -d '{"topic": "AI in legal tech 2025"}'

Template Syntax

Reference data from the trigger input and previous steps using {{template}} syntax:

Trigger Input

Access fields from the webhook request body directly:
{{fieldName}}       → Value from webhook body
{{nested.field}}    → Nested fields work too

Previous Step Output

Access results from earlier steps in the workflow:
{{results.StepLabel.output}}              → Entire output object
{{results.StepLabel.output.fieldName}}    → Specific field
{{results.StepLabel.output.items[0]}}     → Array access
Examples:
{{results.Search_Web.output.results}}
{{results.Summarize.output.choices[0].message.content}}
{{results.OCR_Document.output.text}}
Note: Step labels with spaces become underscores: “Search Web” → Search_Web

Available Action Types

case-llm/llm

Generate text with LLMs (OpenAI, Anthropic, etc.)
FieldDescription
methodchat, complete, or list-models
modelModel ID (gpt-4o, claude-3-5-sonnet, etc.)
systemPromptSystem instructions
userPromptUser message with templates
temperature0-2, controls randomness
maxTokensMaximum output tokens
Search the web for real-time information.
FieldDescription
querySearch query
searchTypeauto, general, news, or academic
numResultsNumber of results (default: 5)

case-vault/search

Search documents in a vault.
FieldDescription
vaultIdVault ID
querySearch query
methodhybrid, vector, graph, or entity
limitMax results (default: 10)

case-ocr/process

Extract text from images or scanned PDFs.
FieldDescription
documentUrlURL to document
enginegpt-4o, doctr, or paddleocr

case-voice/transcribe

Transcribe audio files.
FieldDescription
audioUrlURL to audio file
modelwhisper-1 or whisper-large-v3
languageOptional language code

case-format/format

Convert content to PDF, DOCX, or HTML.
FieldDescription
contentMarkdown or text content
inputFormatmd or txt
outputFormatpdf, docx, or html

HTTP Request

Make custom HTTP requests to external APIs.
FieldDescription
methodGET, POST, PUT, PATCH, DELETE
urlTarget URL
bodyRequest body (JSON)
headersCustom headers (JSON)

Execution Modes

Fire-and-Forget (Default)

Trigger the workflow and check status later:
curl -X POST ".../webhook" \
  -H "X-Webhook-Secret: whsec_..." \
  -d '{"input": "data"}'
Response includes executionId for status checks.

Synchronous (Wait for Result)

Block until the workflow completes:
curl -X POST ".../webhook?mode=sync" \
  -H "X-Webhook-Secret: whsec_..." \
  -d '{"input": "data"}'
Returns the final output directly.

Callback Webhook

Get notified when complete:
curl -X POST ".../webhook" \
  -H "X-Webhook-Secret: whsec_..." \
  -H "X-Callback-Url: https://your-app.com/webhook" \
  -d '{"input": "data"}'
Your callback URL receives the final result.

Example Workflows

Document Analysis Pipeline

{
  "name": "Document Analysis",
  "nodes": [
    {
      "id": "trigger",
      "type": "trigger",
      "label": "Webhook",
      "config": { "triggerType": "Webhook" }
    },
    {
      "id": "ocr",
      "type": "action",
      "label": "Extract Text",
      "config": {
        "actionType": "case-ocr/process",
        "documentUrl": "{{documentUrl}}",
        "engine": "gpt-4o"
      }
    },
    {
      "id": "analyze",
      "type": "action",
      "label": "Analyze",
      "config": {
        "actionType": "case-llm/llm",
        "method": "chat",
        "model": "gpt-4o",
        "systemPrompt": "You are a document analyst. Extract key facts, dates, and parties.",
        "userPrompt": "Analyze this document:\n\n{{results.Extract_Text.output.text}}"
      }
    }
  ],
  "edges": [
    { "source": "trigger", "target": "ocr" },
    { "source": "ocr", "target": "analyze" }
  ]
}

Research Agent

{
  "name": "Research Agent",
  "nodes": [
    {
      "id": "trigger",
      "type": "trigger",
      "label": "Webhook",
      "config": { "triggerType": "Webhook" }
    },
    {
      "id": "search",
      "type": "action",
      "label": "Research",
      "config": {
        "actionType": "case-search/web-search",
        "query": "{{query}}",
        "numResults": "10"
      }
    },
    {
      "id": "synthesize",
      "type": "action",
      "label": "Synthesize",
      "config": {
        "actionType": "case-llm/llm",
        "method": "chat",
        "model": "gpt-4o",
        "systemPrompt": "Synthesize the research into a comprehensive summary with citations.",
        "userPrompt": "Research results:\n{{results.Research.output.results}}"
      }
    },
    {
      "id": "format",
      "type": "action",
      "label": "Create PDF",
      "config": {
        "actionType": "case-format/format",
        "content": "# Research Report\n\n{{results.Synthesize.output.choices[0].message.content}}",
        "inputFormat": "md",
        "outputFormat": "pdf"
      }
    }
  ],
  "edges": [
    { "source": "trigger", "target": "search" },
    { "source": "search", "target": "synthesize" },
    { "source": "synthesize", "target": "format" }
  ]
}

Observability

Monitor your workflow executions in the Visual Builder at workflow.case.dev/runs:
  • Execution History — See all runs with status, duration, timestamps
  • Step Details — Inspect input/output for each step
  • Error Logs — Debug failed executions
Or query via API:
# List executions for a workflow
GET /workflows/v1/{id}/runs

# Get execution details
GET /workflows/v1/runs/{executionId}

Pricing

Workflows are billed per execution based on underlying service usage:
  • Relay Execution — $0.0001 per step execution
  • LLM Tokens — Standard token pricing
  • OCR Pages — Standard page pricing
  • Search Queries — Standard query pricing
View detailed usage in the Console.

Next Steps

Workflows can orchestrate any Case.dev service: