# Tensorify — Full Documentation for AI Agents > Visual workflow builder for developers. Design webhook handlers, API endpoints, and AI agents on a drag-and-drop canvas. Run on your machine or Tensorify Cloud. Node-by-node debugging, 30+ built-in plugins, self-hosted or managed. Website: https://tensorify.io App: https://app.tensorify.io Docs: https://tensorify.io/docs MCP Platform: https://mcp.tensorify.io --- ## What Is Tensorify? Tensorify is a visual workflow builder for developers. Users drag nodes onto a canvas, wire them together, and deploy the result as production webhook handlers, API endpoints, or AI agents. The system transpiles visual workflows into executable Python code. Key capabilities: - Visual drag-and-drop canvas with node-by-node debugging - 30+ built-in plugins (triggers, actions, logic, AI, integrations) - Two execution modes: managed cloud or self-hosted CLI runner - MCP Platform Server: 20 tools for AI agents to manage your workspace (Cursor, Claude Desktop, any MCP client) - MCP Trigger: expose any workflow as a callable tool for AI agents - OpenAI-compatible endpoint for AI agents (any workflow becomes a model) - Built-in Playground for testing APIs and chatting with agents - In-canvas AI Assistant for building/modifying workflows from natural language - Team workspaces with RBAC - Template library for instant start - First-party integrations: Slack, Discord, Telegram, GitHub, Notion, Stripe, PostgreSQL, S3, Resend, Twilio, Web Search - Local machine plugins: File Ops, Shell (with process management), System Info --- ## MCP Platform Server The MCP Platform Server at `https://mcp.tensorify.io/v1/platform` exposes 20 tools for AI agents to manage Tensorify workspaces programmatically. Authentication is via Bearer token (API key from Settings → API Keys). ### Available MCP Tools **Workflow Management:** - `list_workflows` — List all workflows in a project - `get_workflow` — Get workflow details (nodes, edges, TSL) - `create_workflow` — Create a new empty workflow - `apply_tsl` — Apply TSL code to a workflow (full replace) - `patch_tsl` — Modify existing TSL (add/remove nodes or edges) - `delete_workflow` — Delete a workflow **Execution & Deployment:** - `deploy_workflow` — Deploy a workflow (CLI or managed mode) - `undeploy_workflow` — Stop a deployment - `execute_workflow` — Trigger execution of a deployed workflow - `get_run` — Get execution run details and logs - `list_runs` — List recent runs for a workflow **Plugin & Project Management:** - `list_plugins` — List all available plugins with schemas - `get_plugin` — Get detailed plugin manifest - `list_projects` — List projects in workspace - `create_project` — Create a new project **Environment & Configuration:** - `list_env_vars` — List workspace environment variables - `set_env_var` — Create or update an environment variable - `delete_env_var` — Remove an environment variable **Introspection:** - `get_tsl_grammar` — Get TSL grammar reference for writing valid TSL - `validate_tsl` — Validate TSL code before applying ### MCP Trigger (Expose Workflows as Tools) The MCP Trigger plugin lets you expose any workflow as a callable MCP tool. AI agents discover your tools at `https://mcp.tensorify.io/v1/triggers`. To expose a workflow: 1. Add an MCP Trigger node to your workflow 2. Configure: tool name, description, JSON Schema for parameters 3. Deploy the workflow 4. AI agents can now discover and invoke it ### CLI Setup for AI IDEs Run `tensorify mcp config` to get ready-to-paste configuration for: - **Cursor** (`.cursor/mcp.json`) - **Claude Desktop** (`claude_desktop_config.json`) The command outputs both platform tools and any deployed MCP trigger tools. --- ## Core Concepts **Workflow**: A directed graph of nodes connected by edges. Each workflow has a trigger (entry point) and zero or more action/logic nodes. **Nodes**: Functional units — triggers (start execution), actions (do work), logic (control flow), and AI (LLM-powered reasoning). **Edges**: Data flows between nodes through edges. Each edge carries the output of one node to the input of another. **TSL (Tensorify Scripting Language)**: A declarative DSL for defining workflows as code. Used by AI agents and the AI Assistant to create/modify workflows without manipulating the visual graph directly. **Execution Modes**: - Managed (Tensorify Cloud): Workflows run on Tensorify's infrastructure. Zero setup. - Self-Hosted (CLI Runner): Workflows run on your machine via `tensorify runner start`. Data stays on your network. **Runner**: The `tensorify` CLI binary that executes workflows locally. Install via `curl -fsSL https://cli.tensorify.io/install | sh`. --- ## Plugins (30+ Built-in) ### Triggers (7 — Entry Points) **Manual Trigger**: Start a workflow manually from the canvas, CLI, or as a callable subworkflow. Has a customizable mock payload for testing. **Webhook Trigger**: Receive HTTP POST events from external services (Stripe, GitHub, etc.). Supports HMAC signature verification and header-secret authentication. Emits `webhook.body`, `webhook.headers`, `webhook.query`, `webhook.method`. **API Endpoint Trigger**: Expose a programmable HTTP endpoint. Supports GET, POST, PUT, PATCH, DELETE. Authentication via API key or bearer token. Synchronous responses via a Return node. Emits `api_request.body`, `api_request.headers`, `api_request.query`, `api_request.method`. Protocol modes: - REST (default): Standard JSON request/response. - OpenAI Chat: Makes the endpoint compatible with OpenAI SDKs. Translates `messages[]` to workflow input and formats output as `ChatCompletion`. Supports SSE streaming with `delta.content` chunks. Use `X-Tensorify-Session-Id` header for session continuity. **MCP Trigger**: Expose a workflow as a callable MCP tool. Configure tool name, description, and parameter JSON Schema. AI agents discover and invoke the tool at `mcp.tensorify.io/v1/triggers`. Synchronous execution — result returned to calling agent. **Slack Trigger**: Listen for Slack events (messages, mentions, reactions). Requires `SLACK_BOT_TOKEN`. Emits `slack.event`, `slack.user`, `slack.channel`, `slack.text`. **Discord Trigger**: Listen for Discord events (messages, reactions). Requires `DISCORD_BOT_TOKEN`. Emits `discord.event`, `discord.user`, `discord.channel`, `discord.content`. **Telegram Trigger**: Listen for Telegram messages and commands. Requires `TELEGRAM_BOT_TOKEN`. Emits `telegram.message`, `telegram.user`, `telegram.chat`. ### Actions (17) **HTTP Request**: Call any external API. Supports GET, POST, PUT, PATCH, DELETE. Configure URL, headers, body, and query params. Supports template bindings. **Transform**: Reshape data declaratively with template bindings. Build new JSON objects from upstream values without code. **Code (Python)**: Run custom Python code. Access upstream data via `input`, use `os.environ` for secrets, install pip packages. Return any serializable value. **Slack Send**: Send messages to Slack channels or threads. Requires `SLACK_BOT_TOKEN`. Configure channel, message text, optional blocks. **Discord Send**: Send messages to Discord channels. Requires `DISCORD_BOT_TOKEN`. Configure channel ID, message content, optional embeds. **Telegram Send**: Send messages to Telegram chats. Requires `TELEGRAM_BOT_TOKEN`. Configure chat ID, message text, parse mode. **GitHub**: Interact with GitHub API — create issues, comment on PRs, list repos, manage labels. Requires `GITHUB_TOKEN`. Unified plugin with operation selector. **Notion**: Interact with Notion API — create pages, query databases, update properties. Requires `NOTION_API_KEY`. Unified plugin with operation selector. **Stripe**: Interact with Stripe API — create charges, manage customers, list subscriptions. Requires `STRIPE_SECRET_KEY`. Unified plugin with operation selector. **PostgreSQL**: Execute SQL queries against PostgreSQL databases. Requires `DATABASE_URL`. Supports SELECT, INSERT, UPDATE, DELETE with parameterized queries. **S3**: Object storage operations — upload, download, list, delete. Requires `S3_ACCESS_KEY_ID`, `S3_SECRET_ACCESS_KEY`, `S3_ENDPOINT`, `S3_BUCKET`. Compatible with AWS S3, MinIO, R2. **Resend Email**: Send transactional email via Resend API. Requires `RESEND_API_KEY`. Configure from, to, subject, HTML/text body. **Twilio SMS**: Send SMS messages via Twilio. Requires `TWILIO_ACCOUNT_SID`, `TWILIO_AUTH_TOKEN`, `TWILIO_PHONE_NUMBER`. **Web Search**: Search the web using Tavily API. Requires `TAVILY_API_KEY`. Returns structured search results with snippets. **File Ops**: Local filesystem operations — read, write, list, delete, find-and-replace. Works on the runner's machine. **Shell**: Execute shell commands with full process management — start, wait, kill, get status. Background process support. Configurable timeout and max concurrent processes. **System Info**: Get machine/OS information — CPU, memory, disk, platform, uptime. **Subworkflow**: Call another Tensorify workflow and use its return value. Enables composition and reuse. ### Logic (4) **If**: Branch on a boolean condition — true path and false path. **Switch**: Route execution across multiple named cases based on an expression value. **Stop**: Terminate the current execution path. **Return**: Return a value from the workflow. Used for synchronous API responses and subworkflow outputs. ### AI Plugins (4) **AI Agent**: Autonomous LLM agent with a ReAct (Reasoning + Acting) loop. Handles: - Tool calling: Connect any action node to the Tools handle - Memory: Connect Window Memory or Qdrant Memory to the Memory handle - Streaming: SSE token streaming when used with API Endpoint (openai-chat protocol) - Providers: OpenAI, Anthropic, or any OpenAI-compatible endpoint (DeepSeek, Ollama, Together AI, etc.) - Settings: provider, model, temperature, systemPrompt, maxIterations, retryCount, outputSchema, streaming, sessionKey - Output: `ai_agent.answer`, `ai_agent.tool_calls`, `ai_agent.iterations`, `ai_agent.usage`, `ai_agent.warning` - Error handling: control output "On Error" for error branch - Secrets: `OPENAI_API_KEY` (OpenAI), `ANTHROPIC_API_KEY` (Anthropic), `CUSTOM_API_KEY` (custom providers) - Max 20 tool connections per agent **Window Memory**: Sliding window conversation history. Keeps the last N messages (configurable `windowSize`). Stored in workflow state (SQLite). Supports persistent and in-memory modes. Best for short conversations and prototyping. **Qdrant Memory**: Vector store memory using Qdrant and OpenAI embeddings. Hybrid recall: recent messages + semantic search (top-K). Best for long-term recall, support agents, and RAG systems. Requires `OPENAI_API_KEY` and `QDRANT_API_KEY`. **MCP Tool Provider**: Connects external MCP (Model Context Protocol) servers to AI agents. All tools from the MCP server are automatically available. HTTP transport only (SSE not yet implemented). Optional `MCP_API_KEY` for authenticated servers. --- ## OpenAI-Compatible Endpoint Any workflow with an API Endpoint trigger set to `protocol: openai-chat` becomes an OpenAI-compatible model endpoint. This means: 1. Set `protocol` to `openai-chat` on the API Endpoint trigger 2. Deploy the workflow 3. Use any OpenAI SDK to connect: ```python from openai import OpenAI client = OpenAI( base_url="https://triggers.tensorify.io/h/YOUR_HOOK_ID/v1", api_key="your-bearer-token" ) response = client.chat.completions.create( model="my-agent", messages=[{"role": "user", "content": "Hello!"}], stream=True # SSE streaming supported ) ``` Endpoints exposed: - `POST .../chat/completions` — send messages, get responses - `GET .../models` — list available models Request translation: `messages[]` array is parsed into `user_message`, `system_prompt`, and `history` for the workflow. Response format: Standard `ChatCompletion` with `choices[].message.content`. Streaming returns `delta.content` chunks with `[DONE]` sentinel. Session continuity: Send `X-Tensorify-Session-Id` header to scope memory per conversation thread. --- ## Playground The Playground is a bottom panel in the canvas editor for testing deployed workflows. It has two modes: **API Mode**: For REST endpoints. Send HTTP requests with a method selector, JSON body editor, and response viewer. **Chat Mode**: For AI agents (when API trigger protocol is `openai-chat`). Real-time SSE streaming, message history, tool call visualization. Uses `X-Tensorify-Session-Id` for session continuity. The Playground sends real requests to the deployed endpoint — the workflow must be deployed first. --- ## Environment Variables (Secrets) Store secrets in Settings > Environment Variables. Available in Code nodes via `os.environ` and in settings fields via `{{ env.VARIABLE_NAME }}`. Common secrets by plugin: - `OPENAI_API_KEY` — OpenAI models + embeddings (AI Agent, Qdrant Memory) - `ANTHROPIC_API_KEY` — Anthropic Claude models (AI Agent) - `CUSTOM_API_KEY` — Custom OpenAI-compatible endpoints (AI Agent) - `QDRANT_API_KEY` — Qdrant Cloud authentication (Qdrant Memory) - `MCP_API_KEY` — MCP server authentication (MCP Tool Provider) - `RESEND_API_KEY` — Resend email service (Resend Email) - `SLACK_BOT_TOKEN` — Slack integration (Slack Trigger, Slack Send) - `DISCORD_BOT_TOKEN` — Discord integration (Discord Trigger, Discord Send) - `TELEGRAM_BOT_TOKEN` — Telegram integration (Telegram Trigger, Telegram Send) - `GITHUB_TOKEN` — GitHub API access (GitHub) - `NOTION_API_KEY` — Notion API access (Notion) - `STRIPE_SECRET_KEY` — Stripe API access (Stripe) - `DATABASE_URL` — PostgreSQL connection string (PostgreSQL) - `S3_ACCESS_KEY_ID`, `S3_SECRET_ACCESS_KEY`, `S3_ENDPOINT`, `S3_BUCKET` — S3 storage (S3) - `TWILIO_ACCOUNT_SID`, `TWILIO_AUTH_TOKEN`, `TWILIO_PHONE_NUMBER` — Twilio SMS - `TAVILY_API_KEY` — Web Search (Tavily) --- ## Use Cases by Persona ### For Developers - Personal AI coding assistant endpoint (API Trigger openai-chat + AI Agent) - API mock server / prototype APIs in 10 minutes - CI/CD webhook processor (GitHub events → logic → downstream APIs) - Personal knowledge base bot with RAG (AI Agent + Qdrant Memory + HTTP tools) - Cron-like scheduled data sync (Manual Trigger called from GitHub Actions/cron) - Webhook-to-Slack/Discord/Telegram relay - GitHub issue triage bot (GitHub Trigger → AI Agent → GitHub comment/label) - AI-powered code review workflow (PR webhook → Code analysis → Slack notification) ### For AI Agent Users (MCP) - Let Cursor/Claude build and deploy workflows for you via MCP Platform Server - Expose internal APIs as MCP tools for your AI coding agent - Build custom AI tools visually and make them available to any MCP client - Automate repetitive development tasks (CI notifications, PR checks, deploy pipelines) ### For Startups - Customer support chatbot with memory (AI Agent + Window Memory + HTTP lookup) - Stripe webhook handler (Switch by event type + DB update + email) - Lead qualification bot (webhook → AI scores lead → routes to CRM) - AI-powered search API / RAG system (AI Agent + Qdrant Memory for semantic search) - Onboarding automation (signup webhook → welcome email → multi-service provisioning) - Internal tooling API (authenticated endpoints composing multiple services) - Slack/Discord community bot (trigger → AI Agent → send response) ### For Businesses - Invoice/document processing (webhook → AI extracts fields → accounting API) - Report generation endpoint (fetch data from 3 sources → AI summarizes → return) - Approval workflow (form submission → AI reviews → approve/reject API calls) - Customer feedback analyzer (webhook → AI categorizes sentiment → stores via API) - Email alert system (monitoring webhooks → route by severity → email right team) - Database automation (PostgreSQL trigger → Transform → Slack notification) ### For Non-Technical Users - AI chatbot for website (one-click template, no code) - Email notification on form submission (visual wiring, just configure URLs) - Personal AI assistant (template + Playground Chat to test) - Simple API that returns data (template → customize transform → deploy) - Templates + Playground + managed cloud = no code, CLI, or infrastructure needed ### For Automation Engineers (n8n/Zapier Power Users) - Complex multi-step automations with full programming constructs (if/switch/code) - Custom Python logic in automations (Code node with pip packages) - AI-augmented automations (AI Agent decides actions based on context) - Self-hosted execution (CLI runner, systemd service, data stays on your network) - OpenAI-compatible deployment (unique to Tensorify — any workflow becomes a model endpoint) - MCP tool ecosystem (connect any MCP-compatible tool server + expose your workflows as tools) - Subworkflow composition (reusable, parameterized workflow pieces) - First-party messaging integrations (Slack, Discord, Telegram — no HTTP config needed) - Database-driven automations (PostgreSQL plugin for direct DB operations) --- ## RAG (Retrieval-Augmented Generation) Tensorify supports building RAG systems using existing plugins. ### Agent-Driven RAG (Simplest) API Trigger → AI Agent + Qdrant Memory → Return The Qdrant Memory plugin automatically performs semantic search on each message, injecting relevant context into the agent's prompt. The agent generates an answer grounded in the retrieved documents. ### Explicit RAG Pipeline (More Control) API Trigger → Code (chunk/preprocess query) → HTTP Request (search Qdrant directly) → Transform (format context) → AI Agent → Return ### Document Ingestion Workflow Webhook receives documents → Code node chunks text → HTTP Request upserts embeddings to Qdrant What Tensorify handles: embedding generation (OpenAI), vector search (Qdrant), hybrid retrieval (recent + semantic top-K), conversation memory. What the user provides: Qdrant instance (cloud or self-hosted), document source. --- ## Competitive Comparison | Feature | Tensorify | Zapier | n8n | Flowise | |---------|-----------|--------|-----|---------| | Visual builder | Yes | Yes | Yes | Yes | | AI agents with tool calling | Yes | No | Limited | Yes | | MCP Platform (AI manages workspace) | Yes (20 tools) | No | No | No | | MCP Trigger (workflow as tool) | Yes | No | No | No | | Custom Python code | Yes | No | Yes | No | | Self-hosted execution | Yes (CLI runner) | No | Yes | Yes | | OpenAI-compatible endpoint | Yes | No | No | Yes | | First-party integrations | 30+ (Slack, Discord, Telegram, GitHub, Notion, Stripe, PostgreSQL, S3, etc.) | 6000+ | 400+ | ~20 | | Conversation memory | Yes (Window + Qdrant) | No | No | Yes | | SSE streaming | Yes | No | No | Yes | | Built-in auth (API key, bearer) | Yes | Yes | Yes | Yes | | Interactive Playground | Yes | No | No | Yes | | Synchronous API responses | Yes | No | Yes | Yes | | Python export (portable code) | Yes | No | No | No | | In-canvas AI Assistant | Yes | No | No | No | | Local machine plugins (File, Shell) | Yes | No | Yes | No | --- ## Troubleshooting FAQ **Q: My agent returns an empty response.** A: Check that the provider API key is set in Environment Variables (e.g. `OPENAI_API_KEY`), the model name is correct, and the system prompt is not empty. **Q: Tools are not showing on the agent node.** A: Connect action nodes (HTTP Request, Code, MCP Server) to the agent's `Tools` handle. Each connected node appears as a tool slot. **Q: Memory is not persisting between messages.** A: Ensure `persistent: true` on Window Memory or that Qdrant is configured correctly. Check that the session key binding resolves to a consistent value per user. **Q: Playground shows "Deploy your workflow first".** A: Deploy the workflow from the Deployments tab in the bottom bar before using the Playground. **Q: OpenAI SDK returns 404.** A: Check that the API trigger's `protocol` is set to `openai-chat`, the `path` is correct, and POST is in `allowedMethods`. **Q: Streaming is not working.** A: Set `streaming: true` on the AI Agent, set `protocol: openai-chat` on the API trigger, and ensure POST is an allowed method. **Q: Runner shows offline.** A: Run `tensorify runner start` and ensure your API key is configured via `tensorify init`. **Q: Webhook returns 401 Unauthorized.** A: Check the auth settings on the trigger (api-key, bearer-token, or header-secret) and ensure the caller sends the correct credentials. **Q: Code node says variable not found.** A: The Code node receives upstream data as `input`. Check that the handle name matches what you're accessing in the code. **Q: MCP tools are not discovered.** A: Verify the MCP server URL is reachable, only HTTP transport is supported (not SSE), and set `MCP_API_KEY` if the server requires authentication. **Q: How do I connect Tensorify to Cursor or Claude Desktop?** A: Run `tensorify mcp config` in your terminal. This generates ready-to-paste MCP configuration for both Cursor (`.cursor/mcp.json`) and Claude Desktop (`claude_desktop_config.json`). You need an API key from Settings → API Keys. **Q: MCP Trigger workflow not being discovered by AI agents.** A: Ensure the workflow is deployed and the MCP Trigger node has a valid tool name and description. The trigger is discoverable at `mcp.tensorify.io/v1/triggers` using the same API key. **Q: Slack/Discord/Telegram plugin says token not set.** A: Set the required token (`SLACK_BOT_TOKEN`, `DISCORD_BOT_TOKEN`, or `TELEGRAM_BOT_TOKEN`) in Settings → Environment Variables in the Tensorify dashboard. --- ## CLI Commands Install: `curl -fsSL https://cli.tensorify.io/install | sh` - `tensorify init` — Guided setup (creates ~/.tensorify/config.json) - `tensorify login` — Authenticate (opens browser) - `tensorify logout` — Remove stored credentials - `tensorify whoami` — Show current user - `tensorify runner start` — Start multi-workflow runner - `tensorify runner install` — Install as systemd/launchd service - `tensorify runner uninstall` — Remove system service - `tensorify export ` — Export workflow to Python - `tensorify mcp config` — Generate MCP config for Cursor/Claude Desktop - `tensorify runtime list` — List cached runtimes - `tensorify runtime clear` — Clear runtime cache - `tensorify self-update` — Update CLI binary --- ## Templates Built-in templates for instant start: - Echo Server (API testing) - Hello World API (simple REST endpoint) - API Proxy (forward requests to external API) - JSON Reshaper (data transformation) - Conditional Alert Router (event routing) - Data Enrichment API (chain APIs) - Custom Python Processor (code execution) - Stripe Webhook Handler (payment processing) - AI Chatbot (simple LLM agent) - AI Agent with Tools (agent + HTTP + Code tools) - Customer Support Agent (agent + memory + tools) - Coding Agent (AI Agent + File Ops + Shell + GitHub tools) --- ## Pricing - **Free**: All 30+ plugins, unlimited workflows, 500 executions/month, 1 hr cloud execution, 50 AI credits, MCP Platform access, self-hosted runner (unmetered time) - **Pro** ($20/month): 5,000 executions/month, 30 hrs cloud execution, 1,000 AI credits, unlimited webhook URLs, 50 concurrent executions, priority support - **Business** ($25/seat/month): 20,000 executions/month (workspace pool), 150 hrs cloud execution, 10,000 AI credits, RBAC, unlimited members, 200 concurrent executions - **Enterprise** (Contact Sales): 2M executions, SSO/SAML, SLA, HIPAA/SOC2, self-hosted deployment, Python code export --- ## Links - Website: https://tensorify.io - App: https://app.tensorify.io - Docs: https://tensorify.io/docs - CLI Install: https://cli.tensorify.io/install - Pricing: https://tensorify.io/pricing - MCP Platform: https://mcp.tensorify.io