Action Steps

Action Steps

Define steps that call case.dev services:

Workflows Step

Execute a pre-built document workflow:

{
  "id": "summarize_depo",
  "service": "workflows",
  "workflow_id": "workflow_uuid",
  "input": {
    "text": "{{input.transcript}}"
  },
  "options": {
    "model": "anthropic/claude-sonnet-4.5",
    "max_tokens": 2000,
    "format": "json"
  }
}

LLM Step

Call the LLM API directly:

{
  "id": "analyze",
  "service": "llm",
  "input": {
    "text": "{{input.case_facts}}"
  },
  "options": {
    "model": "anthropic/claude-sonnet-4.5",
    "max_tokens": 1000,
    "temperature": 0.3
  }
}

Or use messages format:

{
  "id": "chat",
  "service": "llm",
  "input": {
    "messages": [
      {"role": "system", "content": "You are a legal assistant"},
      {"role": "user", "content": "{{input.question}}"}
    ]
  },
  "options": {
    "max_tokens": 500
  }
}

OCR Step

Extract text from documents:

{
  "id": "ocr_doc",
  "service": "ocr",
  "input": {
    "document_url": "{{input.document_url}}"
  },
  "options": {
    "language": "en"
  }
}

Vault Step

Store documents in a vault:

{
  "id": "store",
  "service": "vault",
  "action": "upload",
  "vault_id": "vault_123",
  "input": {
    "filename": "{{input.case_id}}/evidence/{{timestamp}}-summary.json",
    "content": "{{steps.previous_step.output}}",
    "metadata": {
      "case_id": "{{input.case_id}}",
      "processed_at": "{{timestamp}}"
    }
  }
}

Path tips: The filename can include nested folders. For example, {{input.case_id}}/evidence/{{timestamp}}-summary.json will create a deterministic directory structure per case. If you only pass a file name, it will be written at the root of the vault.

Need to bring the stored object back later? Capture the vault response in a follow-up step:

{
  "id": "store",
  "service": "vault",
  "action": "upload",
  "vault_id": "vault_123",
  "input": {
    "filename": "{{input.case_id}}/reports/{{timestamp}}-summary.json",
    "content": "{{steps.summarize.output.content}}"
  }
}

You can reference the upload metadata later with {{steps.store.output.objectId}} to generate signed download URLs or to trigger additional processing.

Voice Step

Transcribe audio:

{
  "id": "transcribe",
  "service": "voice",
  "input": {
    "audio_url": "{{input.audio_url}}"
  },
  "options": {
    "language": "en-US"
  }
}

Service-Specific Options

Workflows Service

{
  "service": "workflows",
  "workflow_id": "uuid",
  "input": {
    "text": "document text"
  },
  "options": {
    "model": "anthropic/claude-sonnet-4.5",
    "max_tokens": 2000,
    "format": "json"
  }
}

LLM Service

{
  "service": "llm",
  "input": {
    "text": "question",
    "messages": [{"role": "user", "content": "question"}]
  },
  "options": {
    "model": "anthropic/claude-sonnet-4.5",
    "max_tokens": 1000,
    "temperature": 0.7
  }
}

OCR Service

{
  "service": "ocr",
  "input": {
    "document_url": "https://..."
  },
  "options": {
    "language": "en"
  }
}

Vault Service

{
  "service": "vault",
  "action": "upload",
  "vault_id": "vault_123",
  "input": {
    "filename": "document.txt",
    "content": "...",
    "metadata": {}
  }
}

Voice Service

{
  "service": "voice",
  "input": {
    "audio_url": "https://..."
  },
  "options": {
    "language": "en-US"
  }
}