Skip to content

wbizmo/inflowforge-api

Repository files navigation

inFlowForge API

A production-style workflow automation platform built with Fastify, TypeScript, PostgreSQL, Redis, BullMQ, and Prisma.

inFlowForge allows developers to build automated workflows using triggers, conditions, actions, webhooks, background processing, and external integrations such as email and Telegram notifications.

The project was built to demonstrate modern backend engineering practices including API design, authentication, queue processing, workflow automation, event-driven architecture, webhook integrations, background workers, and production deployment.


Live Deployment

API

https://inflowforge-api.onrender.com

Health Check

https://inflowforge-api.onrender.com/health

Swagger Documentation

https://inflowforge-api.onrender.com/docs

GitHub Repository

https://github.com/wbizmo/inflowforge-api


Public Testing Credentials

The live deployment includes demo credentials that can be used to explore and test the API.

Demo Admin Token

dev_admin_secret_12345

Example:

curl https://inflowforge-api.onrender.com/admin/analytics/overview \
  -H "x-admin-token: dev_admin_secret_12345"

Demo Workspace API Key

iff_dev_test_key_123456789

Example:

curl https://inflowforge-api.onrender.com/workflows \
  -H "x-api-key: iff_dev_test_key_123456789"

Demo Workflow

cmpuudajr00001se3b6c0jsxp

Trigger the live workflow:

curl -X POST https://inflowforge-api.onrender.com/webhooks/cmpuudajr00001se3b6c0jsxp \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Demo User",
    "email": "demo@example.com",
    "plan": "premium"
  }'

This workflow demonstrates:

  • Workflow Execution
  • Conditional Processing
  • Queue-Based Background Jobs
  • Email Actions
  • Telegram Notifications
  • Execution Logging
  • Analytics Tracking
  • Webhook Processing

Render Free Tier Notice

This project is hosted on Render's free tier.

If the API has been inactive for a period of time, Render may place the service into a sleep state.

If requests appear unavailable:

  1. Visit:

    https://inflowforge-api.onrender.com

  2. Wait for the service to wake up.

  3. Refresh the page.

  4. Retry your request.

Once awake, the API, Swagger documentation, and webhook endpoints will function normally.


Features

Workflow Engine

Create workflows consisting of:

  • Triggers
  • Conditions
  • Actions

Workflows can be executed manually or automatically through webhooks.


Multi-Tenant Architecture

Each workspace is isolated from every other workspace.

Every API key belongs to a specific workspace.

All workflows, executions, analytics, and audit logs are scoped to the owning workspace.


API Key Authentication

Workspace endpoints are protected using API keys.

Example:

x-api-key: YOUR_API_KEY

Admin Authentication

Administrative endpoints are protected using an admin token.

Example:

x-admin-token: YOUR_ADMIN_TOKEN

Webhook Automation

Trigger workflows from external applications.

Example:

POST /webhooks/:workflowId

This allows integrations with:

  • Websites
  • Forms
  • SaaS products
  • Internal systems
  • Third-party applications

Condition Engine

Workflows can execute conditionally.

Example:

{
  "field": "plan",
  "operator": "equals",
  "value": "premium"
}

Only users matching the condition proceed through the workflow.


Action Engine

Supported actions:

Email

Send transactional emails using Resend.

Telegram

Send Telegram bot notifications.

HTTP Requests

Trigger external APIs.

Delay

Pause execution before continuing.

Logging

Create execution logs.


Queue Processing

Workflow execution is asynchronous.

Powered by:

  • Redis
  • BullMQ

Benefits:

  • Fast API responses
  • Background processing
  • Scalable architecture
  • Reliable workflow execution

Audit Logging

All critical actions are recorded:

  • Workflow creation
  • Workflow updates
  • Workflow deletion
  • Execution requests
  • Webhook triggers

Analytics

Administrative analytics include:

  • Workspace counts
  • API key counts
  • Workflow counts
  • Execution counts
  • Success rates
  • Failure rates
  • Audit log totals

Technology Stack

Category Technology
Runtime Node.js
Language TypeScript
Framework Fastify
Database PostgreSQL
ORM Prisma
Queue System BullMQ
Cache / Queue Backend Redis
Database Hosting Neon
Redis Hosting Upstash
Email Resend
Notifications Telegram Bot API
Documentation Swagger / OpenAPI
Deployment Render
Testing Node Test Runner

Architecture

Client
   │
   ▼
Fastify API
   │
   ▼
Authentication Layer
   │
   ▼
Workflow Engine
   │
   ▼
BullMQ Queue
   │
   ▼
Redis
   │
   ▼
Worker
   │
   ▼
Action Engine
   │
   ├── Email (Resend)
   ├── Telegram
   ├── HTTP Requests
   ├── Delay
   └── Logging
   │
   ▼
PostgreSQL

Example Workflow

Premium Signup Workflow

Trigger:

{
  "type": "webhook"
}

Condition:

{
  "field": "plan",
  "operator": "equals",
  "value": "premium"
}

Actions:

[
  {
    "type": "email",
    "to": "{{input.email}}",
    "subject": "Welcome {{input.name}}"
  },
  {
    "type": "telegram",
    "message": "New premium signup: {{input.name}}"
  },
  {
    "type": "log",
    "message": "Premium signup completed"
  }
]

API Documentation

Interactive Swagger documentation is available at:

https://inflowforge-api.onrender.com/docs

The Swagger UI contains:

  • Request schemas
  • Response schemas
  • Endpoint descriptions
  • Authentication requirements
  • Example payloads

Authentication Examples

Workspace Request

curl https://inflowforge-api.onrender.com/workflows \
  -H "x-api-key: iff_dev_test_key_123456789"

Admin Request

curl https://inflowforge-api.onrender.com/admin/analytics/overview \
  -H "x-admin-token: dev_admin_secret_12345"

Example Requests

Health Check

curl https://inflowforge-api.onrender.com/health

List Workflows

curl https://inflowforge-api.onrender.com/workflows \
  -H "x-api-key: iff_dev_test_key_123456789"

Create Workflow

curl -X POST https://inflowforge-api.onrender.com/workflows \
  -H "Content-Type: application/json" \
  -H "x-api-key: iff_dev_test_key_123456789"

Execute Workflow

curl -X POST https://inflowforge-api.onrender.com/workflows/:id/execute \
  -H "Content-Type: application/json" \
  -H "x-api-key: iff_dev_test_key_123456789"

Trigger Webhook

curl -X POST https://inflowforge-api.onrender.com/webhooks/cmpuudajr00001se3b6c0jsxp \
  -H "Content-Type: application/json"

Local Development

Clone Repository

git clone https://github.com/wbizmo/inflowforge-api.git
cd inflowforge-api

Install Dependencies

npm install

Create Environment File

Create a .env file using the values from .env.example.

Generate Prisma Client

npx prisma generate

Push Database Schema

npx prisma db push

Seed Development Data

npx tsx prisma/seed/dev.ts

Start Development Server

npm run dev

.env.example

PORT=4000
NODE_ENV=development

DATABASE_URL=your_postgresql_connection_string

REDIS_HOST=your_redis_host
REDIS_PORT=6379
REDIS_PASSWORD=your_redis_password

ADMIN_TOKEN=your_admin_token

RESEND_API_KEY=your_resend_api_key
RESEND_FROM_EMAIL=your_verified_sender_email

TELEGRAM_BOT_TOKEN=your_telegram_bot_token
TELEGRAM_CHAT_ID=your_telegram_chat_id

Telegram Setup

To use Telegram actions, create a Telegram bot using BotFather.

Step 1: Create a Bot

Open Telegram and search for:

@BotFather

Run:

/newbot

Follow the prompts and BotFather will provide a bot token.

Example:

TELEGRAM_BOT_TOKEN=123456789:AAExampleTokenHere

Step 2: Start a Chat With the Bot

Open your bot in Telegram and send any message such as:

/start

Step 3: Retrieve Your Chat ID

Open the following URL in your browser:

https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates

Example:

https://api.telegram.org/bot123456789:AAExampleTokenHere/getUpdates

You should receive a JSON response similar to:

{
  "ok": true,
  "result": [
    {
      "message": {
        "chat": {
          "id": 1455925018,
          "type": "private"
        }
      }
    }
  ]
}

The value of:

chat.id

is your Telegram Chat ID.

Example:

TELEGRAM_CHAT_ID=1455925018

Step 4: Add to Environment Variables

TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id

Once configured, Telegram workflow actions can send notifications directly to your Telegram account.


Testing

Run all tests:

npm test

Build project:

npm run build

Deployment

Production deployment uses:

  • Render
  • Neon PostgreSQL
  • Upstash Redis
  • Resend
  • Telegram Bot API

The live deployment automatically builds from GitHub.


Author

Williams

GitHub:

https://github.com/wbizmo

Project Repository:

https://github.com/wbizmo/inflowforge-api