Choosing a Trigger

Every Tensorify workflow starts with a trigger — the event that kicks it off. Choosing the right trigger determines how your workflow is invoked, how responses are delivered, and what integrations work out of the box.

The rule is simple:

  • API Trigger — Your workflow IS the product. Users or apps call it.
  • Webhook Trigger — An external system notifies your workflow. Your workflow reacts.
  • Manual Trigger — You (or a cron job) start the workflow on demand.

API Trigger

Use the API Trigger when your workflow is a service that other applications call directly. The workflow receives the request, processes it, and returns a response.

openai-chat Protocol

The primary way to deploy an AI agent as an API. Your workflow becomes a drop-in replacement for OpenAI's /v1/chat/completions endpoint.

Use when: Building chatbots, AI assistants, conversational APIs, or any endpoint consumed by OpenAI SDKs.

How it works:

  • Exposes /v1/chat/completions (POST) and /v1/models (GET)
  • Accepts standard OpenAI request format (messages, model, stream, temperature)
  • Returns OpenAI-compatible responses (both streaming SSE and non-streaming JSON)
  • Compatible with OpenAI Python SDK, Node.js SDK, Vercel AI SDK, LangChain, and any OpenAI-compatible client
from openai import OpenAI

client = OpenAI(
    base_url="https://triggers.tensorify.io/h/whk_.../agent/v1",
    api_key="your-key",
)

response = client.chat.completions.create(
    model="tensorify",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)

rest Protocol

A general-purpose REST API endpoint. Your workflow handles HTTP requests with full control over methods, paths, request parsing, and response formatting.

Use when: Building custom APIs, CRUD endpoints, data processing services, or any non-AI HTTP service.

Webhook Trigger

Use the Webhook Trigger when an external system sends events to your workflow. Your workflow reacts to external events — it doesn't initiate the conversation.

Use when: Third-party integrations (GitHub, Stripe, Slack), event-driven automation, reacting to external systems.

How it works:

  • External service sends a POST/GET to your webhook URL
  • Workflow processes the event
  • Response is wrapped in output.body — you parse it in your integration code

Examples:

  • GitHub push → run CI checks
  • Stripe payment succeeded → send confirmation email
  • Slack message → process with AI and respond

Response format: The workflow result is in response.output.body. For AI agent workflows, the output follows the OpenAI Chat Completion shape inside output.body.

Manual Trigger

Use the Manual Trigger for workflows you start yourself — from the dashboard, CLI, or on a schedule.

Use when: Scheduled jobs, batch processing, data sync, admin tasks, development/testing.

How it works:

  • Triggered via the Tensorify dashboard "Run" button or tensorify runner start with cron
  • No external endpoint needed
  • Results viewable in the dashboard run history

Decision Table

| Use Case | Trigger | Protocol | |----------|---------|----------| | AI chatbot for end users | API Trigger | openai-chat | | OpenAI SDK integration | API Trigger | openai-chat | | Custom REST API | API Trigger | rest | | GitHub webhook handler | Webhook Trigger | — | | Stripe event processor | Webhook Trigger | — | | Slack bot backend | Webhook Trigger | — | | Scheduled data sync | Manual Trigger | — | | Batch processing job | Manual Trigger | — | | Development testing | Any trigger | — |

AI Agent-Specific Guidance

If your workflow includes an AI Agent node:

  • Users chat with your agent → API Trigger + openai-chat. This is THE way to expose an AI agent as an API.
  • Agent reacts to external events → Webhook Trigger. Parse output.body.choices[0].message.content in your handler.
  • Agent runs on a schedule → Manual Trigger. Check results in the dashboard.
  • Testing during development → The Playground's Chat mode works with all trigger types. No deployment needed to iterate on your agent.

Playground note: The Playground detects AI Agent nodes and enables Chat mode automatically, regardless of which trigger type you use. This is a development tool — for production, use the trigger type that matches your use case.

On this page