# How to Vibe Code Your Own Relay.app (and Stop Paying for It)

> AI-powered workflow automation and integration platform

- Site: https://relay.app
- Category: Workflow Automation
- Verdict: **Solid side project** (68/100 vibecodeable)
- Estimated effort: 2-3 weeks part-time

## Verdict

Build a focused personal automation runner with core AI actions and state persistence, though you will have to skip the expansive proprietary third-party app connector catalog.

Relay.app is fundamentally an orchestration and state-machine engine wrapped in a visual builder. Vibecoding a personal version is entirely feasible if you scope your connector list down to 3 or 4 essential APIs (like Slack, GitHub, and email) rather than trying to match 100+ enterprise integrations. The hardest parts will be building the durable workflow runner that handles asynchronous loops and the human-in-the-loop pause/resume lifecycle without dropping state.

### What you can't replicate

- Pre-built certified OAuth connectors for 100+ third-party enterprise applications
- The exact team workspace permissioning and enterprise compliance posture

## What it does

Relay.app is an AI-powered workflow automation platform that combines traditional multi-step integrations with native AI actions and human-in-the-loop collaboration checkpoints.

### Core features

- Visual drag-and-drop workflow builder with multi-step sequencing
- OAuth credential vault and token manager for business applications
- Asynchronous workflow execution engine with state machine management
- Human-in-the-loop checkpoint system for manual approvals and data review
- Multi-model LLM abstraction layer supporting OpenAI, Anthropic, and Google
- Model Context Protocol (MCP) server integration to expose workflows as tools
- Run history logging, error retries, and data table management

## The business

### Pricing

- Free: Free — Basic access with limited monthly steps and AI credits
- Paid Plans: Tiered — Subscription model based on step volume and AI credit usage

### Funding

$8.1M raised.
- Seed Round (October 2022) - $5M
- Seed Extension (October 2023) - $3.1M
Investors: Andreessen Horowitz (a16z), Khosla Ventures, Balderton Capital, BoxGroup, Neo, Entropia Capital

Founded 2021.
Team size: ~3-36 reported active.

## The hard parts

- Building a bulletproof OAuth token lifecycle manager across third-party APIs with varying refresh semantics
- Architecting a durable asynchronous workflow engine capable of state pausing, resumption, list iteration, and branch retries
- Implementing persistent human-in-the-loop state pausing that securely holds context indefinitely awaiting a web action
- Exposing workflows dynamically as compliant MCP servers for external AI agent consumption

## How to vibe code Relay.app

### Prerequisites

- Node.js (free): Runtime environment for building and executing the full-stack Next.js workflow engine.
- GitHub (free): Code repository hosting and CI/CD deployment connection.

### Recommended AI tools

- Claude Code: Best-in-class agentic coding tool for scaffolding complex backend state machines and multi-file Next.js architecture.
- Cursor: Ideal AI code editor for iterative UI work on the visual workflow canvas and node wiring components.

### Stack

- Frontend: Next.js with Tailwind CSS and React Flow for the visual workflow builder canvas
- Backend: Next.js API Routes powered by Inngest for durable step execution and background state management
- Database: Turso (SQLite at the edge) for lightweight relational workflow definitions and run history storage
- Auth: better-auth for self-hosted, secure single-user authentication without MAU pricing
- Payments: None required for a personal automation runner
- Other: Vercel AI SDK for multi-model LLM abstraction and structured output generation, Resend for sending workflow notification emails

### Hosting

- Vercel (Hosting Next.js frontend and serverless API execution): $0-20/mo
- Turso (Serverless SQLite database for workflow definitions and execution state): $0/mo

### Build guide

1. **Project Scaffolding and Database Schema** — Initialize a Next.js project with Tailwind CSS, configure better-auth, and set up Turso tables for workflows, workflow runs, steps, and user credentials.

```
Create a new Next.js project configured with TypeScript, Tailwind CSS, and better-auth. Set up the database connection to Turso using Drizzle ORM or Prisma. Define the relational schema for workflows (id, name, definition_json, created_at), workflow_runs (id, workflow_id, status, input_data, output_data, current_step_index), workflow_steps (id, workflow_id, step_type, config_json, step_order), and user_credentials (id, user_id, provider_name, encrypted_token_data). Ensure all types are strictly enforced and include proper foreign key constraints and indexes on run history foreign keys.
```

2. **Visual Workflow Builder UI** — Build the drag-and-drop workflow canvas using React Flow where users can sequence triggers, actions, AI steps, and approval gates.

```
Build a visual workflow builder page in Next.js using React Flow. Implement a custom node sidebar allowing users to drag and drop Trigger nodes (Webhook, Manual), Action nodes (HTTP Request, Send Slack Message), AI nodes (Summarize, Extract, Generate), and Human Approval gates onto the canvas. Create an interactive configuration drawer for the selected node that lets users edit JSON parameters and map previous step outputs via handlebars-style variable interpolation (e.g., {{step_1.output}}). Save the resulting graph structure back to the database as a JSON workflow definition.
```

3. **Durable Workflow Execution Engine** — Implement the asynchronous execution engine using Inngest to manage state transitions, retries, branching logic, and step progression.

```
Implement a durable workflow execution engine using Inngest integrated into the Next.js backend. Create an execution runner function that ingests a workflow run ID, fetches its step sequence, and executes each step sequentially or conditionally based on branching logic. Handle variable resolution by parsing input parameters against previous step outputs stored in run state. Implement robust error handling with automatic step retries and write detailed execution logs into the workflow_runs table for every state transition.
```

4. **Multi-Model AI Actions and LLM Abstraction** — Integrate the Vercel AI SDK to support AI text generation, extraction, and summarization actions inside workflow steps across OpenAI and Anthropic.

```
Create an AI action executor module using the Vercel AI SDK that supports dynamic model selection (OpenAI GPT-4o, Anthropic Claude 3.5 Sonnet). Implement specialized step executors for 'Summarize Text', 'Extract Structured Data' (using Zod schema validation for guaranteed JSON output), and 'Custom Prompt Generation'. Ensure AI step tokens and usage are tracked per run, and safely handle API key configuration from user settings or environment variables.
```

5. **Human-in-the-Loop Approval Checkpoints** — Build the pause-and-resume state handling for workflows that encounter a human approval checkpoint, generating secure notification links and resuming execution upon user action.

```
Implement a human-in-the-loop pause and resume mechanism within the Inngest workflow engine. When an execution reaches an approval step, transition the workflow run status to 'paused_waiting_for_approval', generate a secure tokenized approval link sent via Resend, and halt execution. Build a dedicated dashboard page where users can view paused runs, inspect payload data, and click 'Approve' or 'Reject'. Clicking the action button must invoke a backend webhook that resumes the Inngest step function with the reviewer's input data.
```

6. **Model Context Protocol (MCP) Server Export** — Expose custom workflow definitions as compliant Model Context Protocol (MCP) endpoints so external AI agents can discover and invoke them as tools.

```
Build an MCP server endpoint in the Next.js app using the Model Context Protocol TypeScript SDK. The endpoint must dynamically inspect the user's saved workflows and expose them as callable MCP tools with explicit input schema definitions derived from step configurations. Implement secure API key authentication for incoming MCP tool execution requests, mapping incoming agent tool calls directly into the asynchronous workflow execution engine and returning structured execution outputs.
```

### Cost vs paying

**Starting costs (one-time):**

- Domain name (optional): $12/yr
- Total: ~$12 one-time

**Ongoing costs (monthly):**

- Vercel Hobby / Turso / Resend: $0/mo
- AI API Usage (OpenAI / Anthropic for workflow AI steps): ~$5-15/mo
- Total: ~$5-15/mo

- Paying for the SaaS instead: $30-100/mo (Prior Paid Plan equivalents)
- Build time: 40-60 hours
- AI tool credits: $20/mo (Claude Pro / Cursor)
- Break-even: N/A (Personal build for utility/learning)

## Sources

- [Relay.app Official Site & Wind-Down Notice](https://relay.app)
- [PR Newswire: Relay.app Launch](https://www.prnewswire.com/news-releases/relayapp-launches-ai-powered-workflow-automation-product-backed-by-andreessen-horowitz-301952659.html)