Skip to main content
Connectors are dynamic integrations with external services defined in the Runflow backend. They support two modes of usage:
  1. As Tools - For agent execution (LLM decides when to call)
  2. Direct Invocation - For programmatic execution (you control when to call)

Key Features

  • 🔄 Dynamic Schema Loading - Schemas are fetched from the backend automatically
  • 🎭 Transparent Mocking - Enable mock mode for development and testing
  • 🛣️ Path Parameter Resolution - Automatic extraction and URL building
  • Lazy Initialization - Schemas loaded only when needed, cached globally
  • 🔐 Flexible Authentication - Supports API Key, Bearer Token, Basic Auth, OAuth2
  • 🔄 Multiple Credentials - Override credentials per execution (multi-tenant support)
  • Type-Safe - Automatic JSON Schema → Zod → LLM Parameters conversion

Usage Mode 1: As Agent Tool

Use connectors as tools that the LLM can call automatically
Resource Identifier: Use the resource slug (e.g., get-customers, list-users) which is auto-generated from the resource name. Slugs are stable, URL-safe identifiers that won’t break if you rename the resource display name.

Usage Mode 2: Direct Invocation

Call connectors programmatically, without agent involvement. Works anywhere: standalone scripts, workflow steps, API handlers.
connector() is a function call, not a client factory. You must pass all 3 arguments (connector slug, resource slug, data) in a single call. It returns a Promise with the result.
Identifiers:
  • Connector: Use the instance slug (e.g., hubspot-prod) - recommended over display name
  • Resource: Use the resource slug (e.g., create-contact) - auto-generated from resource name

Response Format

The response is wrapped in a standard envelope:

Examples

With execution options:
Multi-tenant example:
Authentication Priority:
  1. Custom headers (highest - overrides everything)
  2. credentialId override (runtime override)
  3. Instance credential (default from connector instance)
  4. No authentication

Public APIs — call a template directly (no instance)

For connector templates with authRequired = false (public APIs imported via OpenAPI, like JSONPlaceholder, public REST endpoints, etc.), you can skip the instance step entirely and pass the template slug as the first argument. The resolver tries an instance match first and transparently falls back to the template when no instance exists.
This works for both connector(...) and createConnectorTool({ connector: 'slug', ... }). The shortcut only kicks in when the template has no auth — anything requiring a credential still needs an instance.

Using Connectors in Workflows

Call connector() directly inside a workflow step:

Using .connector() step (native)

The FlowBuilder also has a native .connector() method for simple cases:
The native .connector() step uses template interpolation ({{input.field}}) for parameters. For dynamic logic (conditionals, transformations), use connector() inside a .step() instead.

Using loadConnector Helper

For connectors with many resources, use the loadConnector helper:

Path Parameters

Connectors automatically resolve path parameters from the resource URL:

Mock Execution

Enable mock mode for development and testing:

How It Works

  1. Tool Creation: createConnectorTool creates a tool with a temporary schema
  2. Lazy Loading: On first agent execution, schemas are fetched from the backend in parallel
  3. Schema Conversion: JSON Schema → Zod → LLM Parameters (automatic)
  4. Caching: Schemas are cached globally to avoid repeated API calls
  5. Execution: Tool/API executes with authentication, path resolution, and error handling

Next Steps

Workflows

Orchestrate complex processes

Tools

Learn more about tools

Channels

WhatsApp, Telegram and more — replies are sent through connectors