Skip to main content

Installation

Install the SDK using your preferred package manager:

Requirements

  • Node.js: >= 22.0.0
  • TypeScript: >= 5.0.0 (recommended)

Project Entry Point

Every Runflow project needs a main.ts file at the root that exports an async function main(). This is the function the Runflow engine calls when your agent receives a message:
main.ts

Project Structure

Learn how to organize your project as it grows

Built-in Libraries

The SDK includes the following libraries out-of-the-box. No need to install them separately - they’re available in all your agents:

Quick Examples

You can also use the SDK’s HTTP helpers for convenience:

Environment Variables

Set up your environment variables:

Configuration File

Create a .runflow/rf.json file:
The SDK automatically searches for .runflow/rf.json in the current directory and parent directories. To make these values available as environment variables for external tools (Promptfoo, test runners, custom scripts), add:
See Configuration File for details. Configuration Priority:
  1. Explicit config in code
  2. .runflow/rf.json
  3. Environment variables
  4. Defaults

Manual API Client Configuration

Next Steps

Quick Start

Create your first agent

Core Concepts

Learn about Agents