improvement(docs): simplify docs and add examples/pictures of v5 (#1887)
* improvement(docs): added new platform ss * rename approval to human in the loop * cleanup * remove yml * removed other languages large sections * fix icons
@@ -19,34 +19,6 @@ Der API-Block ermöglicht es Ihnen, Ihren Workflow über API-Endpunkte mit exter
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Überblick
|
||||
|
||||
Der API-Block ermöglicht Ihnen:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Verbindung zu externen Diensten</strong>: HTTP-Anfragen an REST-APIs und Webdienste stellen
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Daten senden und empfangen</strong>: Antworten verarbeiten und Daten aus externen Quellen transformieren
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Integration von Drittanbieter-Plattformen</strong>: Verbindung mit Diensten wie Stripe, Slack oder benutzerdefinierten APIs
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Authentifizierung verwalten</strong>: Unterstützung verschiedener Authentifizierungsmethoden einschließlich Bearer-Tokens und API-Schlüssel
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Funktionsweise
|
||||
|
||||
Der API-Block verarbeitet HTTP-Anfragen durch einen strukturierten Ansatz:
|
||||
|
||||
1. **Anfrage konfigurieren** - URL, Methode, Header und Body-Parameter festlegen
|
||||
2. **Anfrage ausführen** - HTTP-Anfrage an den angegebenen Endpunkt senden
|
||||
3. **Antwort verarbeiten** - Antwortdaten, Statuscodes und Header verarbeiten
|
||||
4. **Fehlerbehandlung** - Timeouts, Wiederholungsversuche und Fehlerbedingungen verwalten
|
||||
|
||||
## Konfigurationsoptionen
|
||||
|
||||
### URL
|
||||
@@ -145,58 +117,12 @@ if (<api.status> === 200) {
|
||||
}
|
||||
```
|
||||
|
||||
## Eingaben und Ausgaben
|
||||
## Ausgaben
|
||||
|
||||
<Tabs items={['Configuration', 'Variables', 'Results']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>URL</strong>: Der Endpunkt, an den die Anfrage gesendet werden soll
|
||||
</li>
|
||||
<li>
|
||||
<strong>Method</strong>: HTTP-Methode (GET, POST, PUT, DELETE, PATCH)
|
||||
</li>
|
||||
<li>
|
||||
<strong>Query Parameters</strong>: Schlüssel-Wert-Paare für URL-Parameter
|
||||
</li>
|
||||
<li>
|
||||
<strong>Headers</strong>: HTTP-Header für Authentifizierung und Inhaltstyp
|
||||
</li>
|
||||
<li>
|
||||
<strong>Body</strong>: Anfrage-Payload für POST/PUT/PATCH-Methoden
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>api.data</strong>: Antwortdaten vom API-Aufruf
|
||||
</li>
|
||||
<li>
|
||||
<strong>api.status</strong>: Vom Server zurückgegebener HTTP-Statuscode
|
||||
</li>
|
||||
<li>
|
||||
<strong>api.headers</strong>: Antwort-Header vom Server
|
||||
</li>
|
||||
<li>
|
||||
<strong>api.error</strong>: Fehlerdetails, falls die Anfrage fehlgeschlagen ist
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Response Data</strong>: Primärer API-Antwortinhalt
|
||||
</li>
|
||||
<li>
|
||||
<strong>Status Information</strong>: HTTP-Status und Fehlerdetails
|
||||
</li>
|
||||
<li>
|
||||
<strong>Access</strong>: Verfügbar in Blöcken nach dem API-Aufruf
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
- **`<api.data>`**: Antwortdaten vom API-Aufruf
|
||||
- **`<api.status>`**: HTTP-Statuscode
|
||||
- **`<api.headers>`**: Antwort-Header
|
||||
- **`<api.error>`**: Fehlerdetails, falls die Anfrage fehlgeschlagen ist
|
||||
|
||||
## Beispielanwendungsfälle
|
||||
|
||||
|
||||
@@ -20,39 +20,6 @@ Der Bedingungsblock ermöglicht es Ihnen, den Ausführungspfad Ihres Workflows b
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Callout>
|
||||
Bedingungsblöcke ermöglichen deterministische Entscheidungsfindung ohne ein LLM zu benötigen, was sie ideal
|
||||
für unkomplizierte Verzweigungslogik macht.
|
||||
</Callout>
|
||||
|
||||
## Überblick
|
||||
|
||||
Der Bedingungsblock ermöglicht Ihnen:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Verzweigungslogik erstellen</strong>: Workflows basierend auf booleschen Ausdrücken leiten
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Datengesteuerte Entscheidungen treffen</strong>: Bedingungen anhand von Ausgaben vorheriger Blöcke auswerten
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Mehrere Szenarien behandeln</strong>: Mehrere Bedingungen mit unterschiedlichen Pfaden definieren
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Deterministische Weiterleitung bieten</strong>: Entscheidungen ohne ein LLM treffen
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Funktionsweise
|
||||
|
||||
Der Bedingungsblock arbeitet durch einen sequentiellen Auswertungsprozess:
|
||||
|
||||
1. **Ausdruck auswerten** - Verarbeitet den JavaScript/TypeScript-booleschen Ausdruck mit aktuellen Workflow-Daten
|
||||
2. **Ergebnis bestimmen** - Gibt basierend auf der Ausdrucksauswertung true oder false zurück
|
||||
3. **Workflow weiterleiten** - Leitet die Ausführung basierend auf dem Ergebnis an den entsprechenden Zielblock weiter
|
||||
4. **Kontext bereitstellen** - Generiert Metadaten über die Entscheidung für Debugging und Überwachung
|
||||
|
||||
## Konfigurationsoptionen
|
||||
|
||||
### Bedingungen
|
||||
|
||||
@@ -23,54 +23,6 @@ Der Antwort-Block ist der letzte Schritt in deinem Workflow, der eine strukturie
|
||||
Antwort-Blöcke sind terminale Blöcke - sie beenden die Workflow-Ausführung und können nicht mit anderen Blöcken verbunden werden.
|
||||
</Callout>
|
||||
|
||||
## Überblick
|
||||
|
||||
Der Antwort-Block ermöglicht dir:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>API-Antworten formatieren</strong>: Strukturierung von Workflow-Ergebnissen in korrekte HTTP-Antworten
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Statuscodes festlegen</strong>: Konfiguration passender HTTP-Statuscodes basierend auf Workflow-Ergebnissen
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Header kontrollieren</strong>: Hinzufügen benutzerdefinierter Header für API-Antworten und Webhooks
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Daten transformieren</strong>: Umwandlung von Workflow-Variablen in client-freundliche Antwortformate
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Wie es funktioniert
|
||||
|
||||
Der Antwort-Block schließt die Workflow-Ausführung ab:
|
||||
|
||||
1. **Daten sammeln** - Sammelt Variablen und Ausgaben von vorherigen Blöcken
|
||||
2. **Antwort formatieren** - Strukturiert Daten gemäß deiner Konfiguration
|
||||
3. **HTTP-Details festlegen** - Wendet Statuscodes und Header an
|
||||
4. **Antwort senden** - Gibt die formatierte Antwort an den API-Aufrufer zurück
|
||||
|
||||
## Wann du Antwort-Blöcke benötigst
|
||||
|
||||
- **API-Endpunkte**: Wenn dein Workflow über eine API aufgerufen wird, formatieren Antwort-Blöcke die Rückgabedaten
|
||||
- **Webhooks**: Rückgabe von Bestätigungen oder Daten an das aufrufende System
|
||||
- **Testen**: Anzeige formatierter Ergebnisse beim Testen deines Workflows
|
||||
|
||||
## Zwei Möglichkeiten zum Erstellen von Antworten
|
||||
|
||||
### Builder-Modus (Empfohlen)
|
||||
Visuelle Oberfläche zum Erstellen der Antwortstruktur:
|
||||
- Felder per Drag-and-Drop einfügen
|
||||
- Einfache Referenzierung von Workflow-Variablen
|
||||
- Visuelle Vorschau der Antwortstruktur
|
||||
|
||||
### Editor-Modus (Fortgeschritten)
|
||||
JSON direkt schreiben:
|
||||
- Volle Kontrolle über das Antwortformat
|
||||
- Unterstützung für komplexe verschachtelte Strukturen
|
||||
- Verwendung der `<variable.name>`Syntax für dynamische Werte
|
||||
|
||||
## Konfigurationsoptionen
|
||||
|
||||
### Antwortdaten
|
||||
|
||||
@@ -21,60 +21,17 @@ Der Router-Block nutzt KI, um intelligent zu entscheiden, welchen Pfad Ihr Workf
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Überblick
|
||||
## Router vs. Bedingung
|
||||
|
||||
Der Router-Block ermöglicht Ihnen:
|
||||
**Router verwenden wenn:**
|
||||
- KI-gestützte Inhaltsanalyse erforderlich ist
|
||||
- Mit unstrukturiertem oder variierendem Inhalt gearbeitet wird
|
||||
- Absichtsbasiertes Routing erforderlich ist (z.B. "Support-Tickets an Abteilungen weiterleiten")
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Intelligentes Content-Routing</strong>: Nutzung von KI zum Verständnis von Absicht und Kontext
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Dynamische Pfadauswahl</strong>: Routing von Workflows basierend auf unstrukturierter Inhaltsanalyse
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Kontextbewusste Entscheidungen</strong>: Treffen intelligenter Routing-Entscheidungen über einfache Regeln hinaus
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Multi-Pfad-Management</strong>: Verwaltung komplexer Workflows mit mehreren potenziellen Zielen
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Router vs. Bedingungsblöcke
|
||||
|
||||
<Accordions>
|
||||
<Accordion title="Wann Router verwenden">
|
||||
- KI-gestützte Inhaltsanalyse erforderlich
|
||||
- Unstrukturierte oder variierende Inhaltstypen
|
||||
- Absichtsbasiertes Routing (z.B. "Support-Tickets an Abteilungen weiterleiten")
|
||||
- Kontextbewusste Entscheidungsfindung erforderlich
|
||||
</Accordion>
|
||||
<Accordion title="Wann Bedingung verwenden">
|
||||
- Einfache, regelbasierte Entscheidungen
|
||||
- Strukturierte Daten oder numerische Vergleiche
|
||||
- Schnelles, deterministisches Routing erforderlich
|
||||
- Boolesche Logik ausreichend
|
||||
</Accordion>
|
||||
</Accordions>
|
||||
|
||||
## Funktionsweise
|
||||
|
||||
Der Router-Block:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Analysiert Inhalte</strong>: Verwendet ein LLM, um Eingabeinhalte und Kontext zu verstehen
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Bewertet Ziele</strong>: Vergleicht Inhalte mit verfügbaren Zielblöcken
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Wählt Ziel aus</strong>: Identifiziert den am besten geeigneten Pfad basierend auf der Absicht
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Leitet Ausführung</strong>: Dirigiert den Workflow zum ausgewählten Block
|
||||
</Step>
|
||||
</Steps>
|
||||
**Bedingung verwenden wenn:**
|
||||
- Einfache regelbasierte Entscheidungen ausreichen
|
||||
- Mit strukturierten Daten oder numerischen Vergleichen gearbeitet wird
|
||||
- Schnelles, deterministisches Routing erforderlich ist
|
||||
|
||||
## Konfigurationsoptionen
|
||||
|
||||
@@ -105,7 +62,7 @@ Wählen Sie ein KI-Modell für die Routing-Entscheidung:
|
||||
**Lokale Modelle**: Jedes Modell, das auf Ollama läuft
|
||||
|
||||
<div className="w-full max-w-2xl mx-auto overflow-hidden rounded-lg">
|
||||
<Video src="router-model-dropdown.mp4" width={500} height={350} />
|
||||
<Video src="models.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
**Empfehlung**: Verwenden Sie Modelle mit starken Reasoning-Fähigkeiten wie GPT-4o oder Claude 3.7 Sonnet für genauere Routing-Entscheidungen.
|
||||
@@ -124,58 +81,6 @@ Nachdem ein Router eine Entscheidung getroffen hat, können Sie auf seine Ausgab
|
||||
- **`<router.cost>`**: Kostenübersicht für den Routing-Aufruf (Eingabe, Ausgabe, Gesamt)
|
||||
- **`<router.model>`**: Das für die Entscheidungsfindung verwendete Modell
|
||||
|
||||
## Erweiterte Funktionen
|
||||
|
||||
### Benutzerdefinierte Routing-Kriterien
|
||||
|
||||
Definieren Sie spezifische Kriterien für jeden Zielblock:
|
||||
|
||||
```javascript
|
||||
// Example routing descriptions
|
||||
Target Block 1: "Technical support issues, API problems, integration questions"
|
||||
Target Block 2: "Billing inquiries, subscription changes, payment issues"
|
||||
Target Block 3: "General questions, feedback, feature requests"
|
||||
```
|
||||
|
||||
## Eingaben und Ausgaben
|
||||
|
||||
<Tabs items={['Konfiguration', 'Variablen']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Inhalt/Prompt</strong>: Zu analysierender Text für Routing-Entscheidungen
|
||||
</li>
|
||||
<li>
|
||||
<strong>Zielblöcke</strong>: Verbundene Blöcke als potenzielle Ziele
|
||||
</li>
|
||||
<li>
|
||||
<strong>Modell</strong>: KI-Modell für Routing-Analyse
|
||||
</li>
|
||||
<li>
|
||||
<strong>API-Schlüssel</strong>: Authentifizierung für ausgewählten LLM-Anbieter
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>router.prompt</strong>: Zusammenfassung des verwendeten Routing-Prompts
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.selected_path</strong>: Details zum gewählten Ziel
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.tokens</strong>: Token-Nutzungsstatistiken
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.cost</strong>: Kostenübersicht für den Routing-Aufruf (Eingabe, Ausgabe, Gesamt)
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.model</strong>: Für die Entscheidungsfindung verwendetes Modell
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Beispielanwendungsfälle
|
||||
|
||||
|
||||
@@ -18,22 +18,6 @@ Der Warten-Block pausiert deinen Workflow für eine bestimmte Zeit, bevor er mit
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Übersicht
|
||||
|
||||
Mit dem Warten-Block kannst du:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Zeitverzögerungen hinzufügen</strong>: Ausführung zwischen Workflow-Schritten pausieren
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Ratenbegrenzungen einhalten</strong>: API-Aufrufe zeitlich verteilen, um innerhalb der Limits zu bleiben
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Sequenzen planen</strong>: Zeitgesteuerte Workflows mit Verzögerungen zwischen Aktionen erstellen
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Konfiguration
|
||||
|
||||
### Wartezeit
|
||||
|
||||
@@ -77,29 +77,6 @@ Sim bietet verschiedene Arten von Blöcken, die spezifische Zwecke in Ihren Work
|
||||
|
||||
Alle Blöcke werden automatisch basierend auf ihren Abhängigkeiten ausgeführt - Sie müssen die Ausführungsreihenfolge oder das Timing nicht manuell verwalten.
|
||||
|
||||
## Ausführungsauslöser
|
||||
|
||||
Workflows können auf verschiedene Weise ausgelöst werden, abhängig von Ihrem Anwendungsfall:
|
||||
|
||||
### Manuelles Testen
|
||||
Klicken Sie im Workflow-Editor auf "Ausführen", um Ihren Workflow während der Entwicklung zu testen. Perfekt für Debugging und Validierung.
|
||||
|
||||
### Geplante Ausführung
|
||||
Richten Sie wiederkehrende Ausführungen mit Cron-Ausdrücken ein. Ideal für regelmäßige Datenverarbeitung, Berichte oder Wartungsaufgaben.
|
||||
|
||||
### API-Bereitstellung
|
||||
Stellen Sie Workflows als HTTP-Endpunkte bereit, die programmatisch von Ihren Anwendungen aufgerufen werden können.
|
||||
|
||||
### Webhook-Integration
|
||||
Reagieren Sie in Echtzeit auf Ereignisse von externen Diensten wie GitHub, Stripe oder benutzerdefinierten Systemen.
|
||||
|
||||
### Chat-Schnittstelle
|
||||
Erstellen Sie Konversationsschnittstellen, die auf benutzerdefinierten Subdomains für benutzerorientierte KI-Anwendungen gehostet werden.
|
||||
|
||||
<Callout type="info">
|
||||
Erfahren Sie mehr über jeden Auslösertyp im [Abschnitt Auslöser](/triggers) der Dokumentation.
|
||||
</Callout>
|
||||
|
||||
## Ausführungsüberwachung
|
||||
|
||||
Wenn Workflows ausgeführt werden, bietet Sim Echtzeit-Einblick in den Ausführungsprozess:
|
||||
|
||||
@@ -96,7 +96,7 @@ Alle öffentlichen Einstiegspunkte—API, Chat, Zeitplan, Webhook und manuelle A
|
||||
|
||||
<div className='flex justify-center my-6'>
|
||||
<Image
|
||||
src='/static/execution/deployment-versions-light.png'
|
||||
src='/static/execution/deployment-versions.png'
|
||||
alt='Tabelle mit Deployment-Versionen'
|
||||
width={500}
|
||||
height={280}
|
||||
|
||||
@@ -5,6 +5,7 @@ description: Empfangen Sie Webhooks von jedem Dienst durch Konfiguration eines
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
<BlockInfoCard
|
||||
type="generic_webhook"
|
||||
@@ -23,6 +24,16 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/webhook.png"
|
||||
alt="Webhook Block Configuration"
|
||||
width={500}
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Übersicht
|
||||
|
||||
Der Generic Webhook-Block ermöglicht es Ihnen, Webhooks von jedem externen Dienst zu empfangen. Dies ist ein flexibler Auslöser, der jede JSON-Nutzlast verarbeiten kann und sich daher ideal für die Integration mit Diensten eignet, die keinen dedizierten Sim-Block haben.
|
||||
|
||||
@@ -11,7 +11,7 @@ Der Zeitplan-Block löst Workflows automatisch nach einem wiederkehrenden Zeitpl
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/schedule.png"
|
||||
src="/static/blocks/schedule.png"
|
||||
alt="Zeitplan-Block"
|
||||
width={500}
|
||||
height={400}
|
||||
@@ -45,10 +45,6 @@ Konfigurieren Sie, wann Ihr Workflow ausgeführt wird, mit den Dropdown-Optionen
|
||||
|
||||
## Zeitpläne konfigurieren
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="configure-schedule.mp4" width={700} height={450} />
|
||||
</div>
|
||||
|
||||
Wenn ein Workflow geplant ist:
|
||||
- Wird der Zeitplan **aktiv** und zeigt die nächste Ausführungszeit an
|
||||
- Klicken Sie auf die Schaltfläche **"Geplant"**, um den Zeitplan zu deaktivieren
|
||||
@@ -58,7 +54,7 @@ Wenn ein Workflow geplant ist:
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/schedule-disabled.png"
|
||||
src="/static/blocks/schedule-3.png"
|
||||
alt="Deaktivierter Zeitplan"
|
||||
width={500}
|
||||
height={350}
|
||||
|
||||
@@ -4,6 +4,7 @@ title: Webhooks
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
Webhooks ermöglichen externen Diensten die Ausführung von Workflows durch das Senden von HTTP-Anfragen an Ihren Workflow. Sim unterstützt zwei Ansätze für webhook-basierte Auslöser.
|
||||
@@ -12,8 +13,14 @@ Webhooks ermöglichen externen Diensten die Ausführung von Workflows durch das
|
||||
|
||||
Der generische Webhook-Block erstellt einen flexiblen Endpunkt, der beliebige Payloads empfangen und Ihren Workflow auslösen kann:
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="webhooks-1.mp4" width={700} height={450} />
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/webhook.png"
|
||||
alt="Generic Webhook Configuration"
|
||||
width={700}
|
||||
height={450}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
### Funktionsweise
|
||||
|
||||
@@ -3,12 +3,10 @@ title: Agent
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
The Agent block serves as the interface between your workflow and Large Language Models (LLMs). It executes inference requests against various AI providers, processes natural language inputs according to defined instructions, and generates structured or unstructured outputs for downstream consumption.
|
||||
The Agent block connects your workflow to Large Language Models (LLMs). It processes natural language inputs, calls external tools, and generates structured or unstructured outputs.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
@@ -18,26 +16,7 @@ The Agent block serves as the interface between your workflow and Large Language
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Overview
|
||||
|
||||
The Agent block enables you to:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Process natural language</strong>: Analyze user input and generate contextual responses
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Execute AI-powered tasks</strong>: Perform content analysis, generation, and decision-making
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Call external tools</strong>: Access APIs, databases, and services during processing
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Generate structured output</strong>: Return JSON data that matches your schema requirements
|
||||
</Step>
|
||||
</Steps>
|
||||
</div>
|
||||
|
||||
## Configuration Options
|
||||
|
||||
@@ -63,38 +42,19 @@ The user prompt represents the primary input data for inference processing. This
|
||||
|
||||
The Agent block supports multiple LLM providers through a unified inference interface. Available models include:
|
||||
|
||||
**OpenAI Models**: GPT-5, GPT-4o, o1, o3, o4-mini, gpt-4.1 (API-based inference)
|
||||
**Anthropic Models**: Claude 3.7 Sonnet (API-based inference)
|
||||
**Google Models**: Gemini 2.5 Pro, Gemini 2.0 Flash (API-based inference)
|
||||
**Alternative Providers**: Groq, Cerebras, xAI, DeepSeek (API-based inference)
|
||||
**Local Deployment**: Ollama-compatible models (self-hosted inference)
|
||||
|
||||
<div className="mx-auto w-3/5 overflow-hidden rounded-lg">
|
||||
<Video src="models.mp4" width={500} height={350} />
|
||||
</div>
|
||||
- **OpenAI**: GPT-5, GPT-4o, o1, o3, o4-mini, gpt-4.1
|
||||
- **Anthropic**: Claude 3.7 Sonnet
|
||||
- **Google**: Gemini 2.5 Pro, Gemini 2.0 Flash
|
||||
- **Other Providers**: Groq, Cerebras, xAI, DeepSeek
|
||||
- **Local Models**: Ollama-compatible models
|
||||
|
||||
### Temperature
|
||||
|
||||
Control the creativity and randomness of responses:
|
||||
Controls response randomness and creativity:
|
||||
|
||||
<Tabs items={['Low (0-0.3)', 'Medium (0.3-0.7)', 'High (0.7-2.0)']}>
|
||||
<Tab>
|
||||
More deterministic, focused responses. Best for factual tasks, customer support, and
|
||||
situations where accuracy is critical.
|
||||
</Tab>
|
||||
<Tab>
|
||||
Balanced creativity and focus. Suitable for general purpose applications that require both
|
||||
accuracy and some creativity.
|
||||
</Tab>
|
||||
<Tab>
|
||||
More creative, varied responses. Ideal for creative writing, brainstorming, and generating
|
||||
diverse ideas.
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<div className="mt-4 text-sm text-gray-600 dark:text-gray-400">
|
||||
The temperature range (0-1 or 0-2) varies depending on the selected model.
|
||||
</div>
|
||||
- **Low (0-0.3)**: Deterministic and focused. Best for factual tasks and accuracy.
|
||||
- **Medium (0.3-0.7)**: Balanced creativity and focus. Good for general use.
|
||||
- **High (0.7-2.0)**: Creative and varied. Ideal for brainstorming and content generation.
|
||||
|
||||
### API Key
|
||||
|
||||
@@ -102,32 +62,19 @@ Your API key for the selected LLM provider. This is securely stored and used for
|
||||
|
||||
### Tools
|
||||
|
||||
Tools extend the agent's capabilities through external API integrations and service connections. The tool system enables function calling, allowing the agent to execute operations beyond text generation.
|
||||
Extend agent capabilities with external integrations. Select from 60+ pre-built tools or define custom functions.
|
||||
|
||||
**Tool Integration Process**:
|
||||
1. Access the Tools configuration section within the Agent block
|
||||
2. Select from 60+ pre-built integrations or define custom functions
|
||||
3. Configure authentication parameters and operational constraints
|
||||
|
||||
<div className="mx-auto w-3/5 overflow-hidden rounded-lg">
|
||||
<Video src="tools.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
**Available Tool Categories**:
|
||||
**Available Categories:**
|
||||
- **Communication**: Gmail, Slack, Telegram, WhatsApp, Microsoft Teams
|
||||
- **Data Sources**: Notion, Google Sheets, Airtable, Supabase, Pinecone
|
||||
- **Web Services**: Firecrawl, Google Search, Exa AI, browser automation
|
||||
- **Development**: GitHub, Jira, Linear repository and issue management
|
||||
- **Development**: GitHub, Jira, Linear
|
||||
- **AI Services**: OpenAI, Perplexity, Hugging Face, ElevenLabs
|
||||
|
||||
**Tool Execution Control**:
|
||||
- **Auto**: Model determines tool invocation based on context and necessity
|
||||
- **Required**: Tool must be called during every inference request
|
||||
- **None**: Tool definition available but excluded from model context
|
||||
|
||||
<div className="mx-auto w-3/5 overflow-hidden rounded-lg">
|
||||
<Video src="granular-tool-control.mp4" width={500} height={350} />
|
||||
</div>
|
||||
**Execution Modes:**
|
||||
- **Auto**: Model decides when to use tools based on context
|
||||
- **Required**: Tool must be called in every request
|
||||
- **None**: Tool available but not suggested to model
|
||||
|
||||
### Response Format
|
||||
|
||||
@@ -177,101 +124,29 @@ Use a `Memory` block with a consistent `id` (for example, `chat`) to persist mes
|
||||
|
||||
See the [`Memory`](/tools/memory) block reference for details.
|
||||
|
||||
## Inputs and Outputs
|
||||
## Outputs
|
||||
|
||||
<Tabs items={['Configuration', 'Variables', 'Results']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>System Prompt</strong>: Instructions defining agent behavior and role
|
||||
</li>
|
||||
<li>
|
||||
<strong>User Prompt</strong>: Input text or data to process
|
||||
</li>
|
||||
<li>
|
||||
<strong>Model</strong>: AI model selection (OpenAI, Anthropic, Google, etc.)
|
||||
</li>
|
||||
<li>
|
||||
<strong>Temperature</strong>: Response randomness control (0-2)
|
||||
</li>
|
||||
<li>
|
||||
<strong>Tools</strong>: Array of available tools for function calling
|
||||
</li>
|
||||
<li>
|
||||
<strong>Response Format</strong>: JSON Schema for structured output
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>agent.content</strong>: Agent's response text or structured data
|
||||
</li>
|
||||
<li>
|
||||
<strong>agent.tokens</strong>: Token usage statistics object
|
||||
</li>
|
||||
<li>
|
||||
<strong>agent.tool_calls</strong>: Array of tool execution details
|
||||
</li>
|
||||
<li>
|
||||
<strong>agent.cost</strong>: Estimated API call cost (if available)
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Content</strong>: Primary response output from the agent
|
||||
</li>
|
||||
<li>
|
||||
<strong>Metadata</strong>: Usage statistics and execution details
|
||||
</li>
|
||||
<li>
|
||||
<strong>Access</strong>: Available in blocks after the agent
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
- **`<agent.content>`**: Agent's response text
|
||||
- **`<agent.tokens>`**: Token usage statistics
|
||||
- **`<agent.tool_calls>`**: Tool execution details
|
||||
- **`<agent.cost>`**: Estimated API call cost
|
||||
|
||||
## Example Use Cases
|
||||
|
||||
### Customer Support Automation
|
||||
**Customer Support Automation** - Handle inquiries with database and tool access
|
||||
```
|
||||
API (Ticket) → Agent (Postgres, KB, Linear) → Gmail (Reply) → Memory (Save)
|
||||
```
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Handle customer inquiries with database access</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>User submits a support ticket via the API block</li>
|
||||
<li>Agent checks orders/subscriptions in Postgres and searches the knowledge base for guidance</li>
|
||||
<li>If escalation is needed, the Agent creates a Linear issue with relevant context</li>
|
||||
<li>Agent drafts a clear email reply</li>
|
||||
<li>Gmail sends the reply to the customer</li>
|
||||
<li>Conversation is saved to Memory to maintain history for future messages</li>
|
||||
</ol>
|
||||
</div>
|
||||
**Multi-Model Content Analysis** - Analyze content with different AI models
|
||||
```
|
||||
Function (Process) → Agent (GPT-4o Technical) → Agent (Claude Sentiment) → Function (Report)
|
||||
```
|
||||
|
||||
### Multi-Model Content Analysis
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Analyze content with different AI models</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Function block processes uploaded document</li>
|
||||
<li>Agent with GPT-4o performs technical analysis</li>
|
||||
<li>Agent with Claude analyzes sentiment and tone</li>
|
||||
<li>Function block combines results for final report</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Tool-Powered Research Assistant
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Research assistant with web search and document access</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>User query received via input</li>
|
||||
<li>Agent searches web using Google Search tool</li>
|
||||
<li>Agent accesses Notion database for internal docs</li>
|
||||
<li>Agent compiles comprehensive research report</li>
|
||||
</ol>
|
||||
</div>
|
||||
**Tool-Powered Research Assistant** - Research with web search and document access
|
||||
```
|
||||
Input → Agent (Google Search, Notion) → Function (Compile Report)
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
|
||||
@@ -3,11 +3,10 @@ title: API
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
The API block enables you to connect your workflow to external services through API endpoints using HTTP requests. It supports various methods like GET, POST, PUT, DELETE, and PATCH, allowing you to interact with virtually any API endpoint.
|
||||
The API block connects your workflow to external services through HTTP requests. Supports GET, POST, PUT, DELETE, and PATCH methods for interacting with REST APIs.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
@@ -19,34 +18,6 @@ The API block enables you to connect your workflow to external services through
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Overview
|
||||
|
||||
The API block enables you to:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Connect to external services</strong>: Make HTTP requests to REST APIs and web services
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Send and receive data</strong>: Process responses and transform data from external sources
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Integrate third-party platforms</strong>: Connect with services like Stripe, Slack, or custom APIs
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Handle authentication</strong>: Support various auth methods including Bearer tokens and API keys
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## How It Works
|
||||
|
||||
The API block processes HTTP requests through a structured approach:
|
||||
|
||||
1. **Configure Request** - Set URL, method, headers, and body parameters
|
||||
2. **Execute Request** - Send HTTP request to the specified endpoint
|
||||
3. **Process Response** - Handle response data, status codes, and headers
|
||||
4. **Error Handling** - Manage timeouts, retries, and error conditions
|
||||
|
||||
## Configuration Options
|
||||
|
||||
### URL
|
||||
@@ -145,84 +116,24 @@ if (<api.status> === 200) {
|
||||
}
|
||||
```
|
||||
|
||||
## Inputs and Outputs
|
||||
## Outputs
|
||||
|
||||
<Tabs items={['Configuration', 'Variables', 'Results']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>URL</strong>: The endpoint to send the request to
|
||||
</li>
|
||||
<li>
|
||||
<strong>Method</strong>: HTTP method (GET, POST, PUT, DELETE, PATCH)
|
||||
</li>
|
||||
<li>
|
||||
<strong>Query Parameters</strong>: Key-value pairs for URL parameters
|
||||
</li>
|
||||
<li>
|
||||
<strong>Headers</strong>: HTTP headers for authentication and content type
|
||||
</li>
|
||||
<li>
|
||||
<strong>Body</strong>: Request payload for POST/PUT/PATCH methods
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>api.data</strong>: Response body data from the API call
|
||||
</li>
|
||||
<li>
|
||||
<strong>api.status</strong>: HTTP status code returned by server
|
||||
</li>
|
||||
<li>
|
||||
<strong>api.headers</strong>: Response headers from the server
|
||||
</li>
|
||||
<li>
|
||||
<strong>api.error</strong>: Error details if request failed
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Response Data</strong>: Primary API response content
|
||||
</li>
|
||||
<li>
|
||||
<strong>Status Information</strong>: HTTP status and error details
|
||||
</li>
|
||||
<li>
|
||||
<strong>Access</strong>: Available in blocks after the API call
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
- **`<api.data>`**: Response body data from the API
|
||||
- **`<api.status>`**: HTTP status code
|
||||
- **`<api.headers>`**: Response headers
|
||||
- **`<api.error>`**: Error details if request failed
|
||||
|
||||
## Example Use Cases
|
||||
|
||||
### Fetch User Profile Data
|
||||
**Fetch User Profile Data** - Retrieve user information from external service
|
||||
```
|
||||
Function (Build ID) → API (GET /users/{id}) → Function (Format) → Response
|
||||
```
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Retrieve user information from external service</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Function block constructs user ID from input</li>
|
||||
<li>API block calls GET /users/{id} endpoint</li>
|
||||
<li>Function block processes and formats user data</li>
|
||||
<li>Response block returns formatted profile</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Payment Processing
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Process payment through Stripe API</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Function block validates payment data</li>
|
||||
<li>API block creates payment intent via Stripe</li>
|
||||
<li>Condition block handles payment success/failure</li>
|
||||
<li>Supabase block updates order status in database</li>
|
||||
</ol>
|
||||
</div>
|
||||
**Payment Processing** - Process payment through Stripe API
|
||||
```
|
||||
Function (Validate) → API (Stripe) → Condition (Success) → Supabase (Update)
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
|
||||
@@ -3,12 +3,10 @@ title: Condition
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Accordion, Accordions } from 'fumadocs-ui/components/accordion'
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
The Condition block allows you to branch your workflow execution path based on boolean expressions, enabling you to create dynamic, responsive workflows with different execution paths. It evaluates conditions and routes the workflow accordingly, letting you control execution flow based on data or logic without requiring an LLM.
|
||||
The Condition block branches workflow execution based on boolean expressions. Evaluate conditions using previous block outputs and route to different paths without requiring an LLM.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
@@ -20,39 +18,6 @@ The Condition block allows you to branch your workflow execution path based on b
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Callout>
|
||||
Condition blocks enable deterministic decision-making without requiring an LLM, making them ideal
|
||||
for straightforward branching logic.
|
||||
</Callout>
|
||||
|
||||
## Overview
|
||||
|
||||
The Condition block enables you to:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Create branching logic</strong>: Route workflows based on boolean expressions
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Make data-driven decisions</strong>: Evaluate conditions using previous block outputs
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Handle multiple scenarios</strong>: Define multiple conditions with different paths
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Provide deterministic routing</strong>: Make decisions without requiring an LLM
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## How It Works
|
||||
|
||||
The Condition block operates through a sequential evaluation process:
|
||||
|
||||
1. **Evaluate Expression** - Processes the JavaScript/TypeScript boolean expression using current workflow data
|
||||
2. **Determine Result** - Returns true or false based on the expression evaluation
|
||||
3. **Route Workflow** - Directs execution to the appropriate destination block based on the result
|
||||
4. **Provide Context** - Generates metadata about the decision for debugging and monitoring
|
||||
|
||||
## Configuration Options
|
||||
|
||||
### Conditions
|
||||
@@ -143,90 +108,29 @@ Conditions automatically handle:
|
||||
- Invalid expressions with error logging
|
||||
- Missing variables with default values
|
||||
|
||||
## Inputs and Outputs
|
||||
## Outputs
|
||||
|
||||
<Tabs items={['Configuration', 'Variables', 'Results']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Conditions</strong>: Array of boolean expressions to evaluate
|
||||
</li>
|
||||
<li>
|
||||
<strong>Expressions</strong>: JavaScript/TypeScript conditions using block outputs
|
||||
</li>
|
||||
<li>
|
||||
<strong>Routing Paths</strong>: Destination blocks for each condition result
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>condition.result</strong>: Boolean result of condition evaluation
|
||||
</li>
|
||||
<li>
|
||||
<strong>condition.matched_condition</strong>: ID of the matched condition
|
||||
</li>
|
||||
<li>
|
||||
<strong>condition.content</strong>: Description of evaluation result
|
||||
</li>
|
||||
<li>
|
||||
<strong>condition.path</strong>: Details of chosen routing destination
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Boolean Result</strong>: Primary condition evaluation outcome
|
||||
</li>
|
||||
<li>
|
||||
<strong>Routing Information</strong>: Path selection and condition details
|
||||
</li>
|
||||
<li>
|
||||
<strong>Access</strong>: Available in blocks after the condition
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
- **`<condition.result>`**: Boolean result of the evaluation
|
||||
- **`<condition.matched_condition>`**: ID of the matched condition
|
||||
- **`<condition.content>`**: Description of the evaluation result
|
||||
- **`<condition.path>`**: Details of the chosen routing destination
|
||||
|
||||
## Example Use Cases
|
||||
|
||||
### Customer Support Routing
|
||||
**Customer Support Routing** - Route tickets based on priority
|
||||
```
|
||||
API (Ticket) → Condition (priority === 'high') → Agent (Escalation) or Agent (Standard)
|
||||
```
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Route support tickets based on priority</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>API block fetches support ticket data</li>
|
||||
<li>Condition checks if `<api.priority>` equals 'high'</li>
|
||||
<li>High priority tickets → Agent with escalation tools</li>
|
||||
<li>Normal priority tickets → Standard support agent</li>
|
||||
</ol>
|
||||
</div>
|
||||
**Content Moderation** - Filter content based on analysis
|
||||
```
|
||||
Agent (Analyze) → Condition (toxicity > 0.7) → Moderation or Publish
|
||||
```
|
||||
|
||||
### Content Moderation
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Filter content based on analysis results</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Agent analyzes user-generated content</li>
|
||||
<li>Condition checks if `<agent.toxicity_score>` > 0.7</li>
|
||||
<li>Toxic content → Moderation workflow</li>
|
||||
<li>Clean content → Publishing workflow</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### User Onboarding Flow
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Personalize onboarding based on user type</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Function block processes user registration data</li>
|
||||
<li>Condition checks if `<user.account_type>` === 'enterprise'</li>
|
||||
<li>Enterprise users → Advanced setup workflow</li>
|
||||
<li>Individual users → Simple onboarding workflow</li>
|
||||
</ol>
|
||||
</div>
|
||||
**User Onboarding Flow** - Personalize onboarding based on user type
|
||||
```
|
||||
Function (Process) → Condition (account_type === 'enterprise') → Advanced or Simple
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
|
||||
@@ -3,12 +3,10 @@ title: Evaluator
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
The Evaluator block uses AI to score and assess content quality using customizable evaluation metrics that you define. Perfect for quality control, A/B testing, and ensuring your AI outputs meet specific standards.
|
||||
The Evaluator block uses AI to score and assess content quality against custom metrics. Perfect for quality control, A/B testing, and ensuring AI outputs meet specific standards.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
@@ -20,34 +18,6 @@ The Evaluator block uses AI to score and assess content quality using customizab
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Overview
|
||||
|
||||
The Evaluator block enables you to:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Score Content Quality</strong>: Use AI to evaluate content against custom metrics with numeric scores
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Define Custom Metrics</strong>: Create specific evaluation criteria tailored to your use case
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Automate Quality Control</strong>: Build workflows that automatically assess and filter content
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Track Performance</strong>: Monitor improvements and consistency over time with objective scoring
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## How It Works
|
||||
|
||||
The Evaluator block processes content through AI-powered assessment:
|
||||
|
||||
1. **Receive Content** - Takes input content from previous blocks in your workflow
|
||||
2. **Apply Metrics** - Evaluates content against your defined custom metrics
|
||||
3. **Generate Scores** - AI model assigns numeric scores for each metric
|
||||
4. **Provide Summary** - Returns detailed evaluation with scores and explanations
|
||||
|
||||
## Configuration Options
|
||||
|
||||
### Evaluation Metrics
|
||||
@@ -78,117 +48,41 @@ The content to be evaluated. This can be:
|
||||
|
||||
Choose an AI model to perform the evaluation:
|
||||
|
||||
**OpenAI**: GPT-4o, o1, o3, o4-mini, gpt-4.1
|
||||
**Anthropic**: Claude 3.7 Sonnet
|
||||
**Google**: Gemini 2.5 Pro, Gemini 2.0 Flash
|
||||
**Other Providers**: Groq, Cerebras, xAI, DeepSeek
|
||||
**Local Models**: Any model running on Ollama
|
||||
- **OpenAI**: GPT-4o, o1, o3, o4-mini, gpt-4.1
|
||||
- **Anthropic**: Claude 3.7 Sonnet
|
||||
- **Google**: Gemini 2.5 Pro, Gemini 2.0 Flash
|
||||
- **Other Providers**: Groq, Cerebras, xAI, DeepSeek
|
||||
- **Local Models**: Ollama-compatible models
|
||||
|
||||
<div className="w-full max-w-2xl mx-auto overflow-hidden rounded-lg">
|
||||
<Video src="models.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
**Recommendation**: Use models with strong reasoning capabilities like GPT-4o or Claude 3.7 Sonnet for more accurate evaluations.
|
||||
Use models with strong reasoning capabilities like GPT-4o or Claude 3.7 Sonnet for best results.
|
||||
|
||||
### API Key
|
||||
|
||||
Your API key for the selected LLM provider. This is securely stored and used for authentication.
|
||||
|
||||
## How It Works
|
||||
|
||||
1. The Evaluator block takes the provided content and your custom metrics
|
||||
2. It generates a specialized prompt that instructs the LLM to evaluate the content
|
||||
3. The prompt includes clear guidelines on how to score each metric
|
||||
4. The LLM evaluates the content and returns numeric scores for each metric
|
||||
5. The Evaluator block formats these scores as structured output for use in your workflow
|
||||
|
||||
## Example Use Cases
|
||||
|
||||
### Content Quality Assessment
|
||||
**Content Quality Assessment** - Evaluate content before publication
|
||||
```
|
||||
Agent (Generate) → Evaluator (Score) → Condition (Check threshold) → Publish or Revise
|
||||
```
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Evaluate blog post quality before publication</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Agent block generates blog post content</li>
|
||||
<li>Evaluator assesses accuracy, readability, and engagement</li>
|
||||
<li>Condition block checks if scores meet minimum thresholds</li>
|
||||
<li>High scores → Publish, Low scores → Revise and retry</li>
|
||||
</ol>
|
||||
</div>
|
||||
**A/B Testing Content** - Compare multiple AI-generated responses
|
||||
```
|
||||
Parallel (Variations) → Evaluator (Score Each) → Function (Select Best) → Response
|
||||
```
|
||||
|
||||
### A/B Testing Content
|
||||
**Customer Support Quality Control** - Ensure responses meet quality standards
|
||||
```
|
||||
Agent (Support Response) → Evaluator (Score) → Function (Log) → Condition (Review if Low)
|
||||
```
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Compare multiple AI-generated responses</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Parallel block generates multiple response variations</li>
|
||||
<li>Evaluator scores each variation on clarity and relevance</li>
|
||||
<li>Function block selects highest-scoring response</li>
|
||||
<li>Response block returns the best result</li>
|
||||
</ol>
|
||||
</div>
|
||||
## Outputs
|
||||
|
||||
### Customer Support Quality Control
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Ensure support responses meet quality standards</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Support agent generates response to customer inquiry</li>
|
||||
<li>Evaluator scores helpfulness, empathy, and accuracy</li>
|
||||
<li>Scores logged for training and performance monitoring</li>
|
||||
<li>Low scores trigger human review process</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
## Inputs and Outputs
|
||||
|
||||
<Tabs items={['Configuration', 'Variables', 'Results']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Content</strong>: The text or structured data to evaluate
|
||||
</li>
|
||||
<li>
|
||||
<strong>Evaluation Metrics</strong>: Custom criteria with scoring ranges
|
||||
</li>
|
||||
<li>
|
||||
<strong>Model</strong>: AI model for evaluation analysis
|
||||
</li>
|
||||
<li>
|
||||
<strong>API Key</strong>: Authentication for selected LLM provider
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>evaluator.content</strong>: Summary of the evaluation
|
||||
</li>
|
||||
<li>
|
||||
<strong>evaluator.model</strong>: Model used for evaluation
|
||||
</li>
|
||||
<li>
|
||||
<strong>evaluator.tokens</strong>: Token usage statistics
|
||||
</li>
|
||||
<li>
|
||||
<strong>evaluator.cost</strong>: Cost summary for the evaluation call
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Metric Scores</strong>: Numeric scores for each defined metric
|
||||
</li>
|
||||
<li>
|
||||
<strong>Evaluation Summary</strong>: Detailed assessment with explanations
|
||||
</li>
|
||||
<li>
|
||||
<strong>Access</strong>: Available in blocks after the evaluator
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
- **`<evaluator.content>`**: Summary of the evaluation with scores
|
||||
- **`<evaluator.model>`**: Model used for evaluation
|
||||
- **`<evaluator.tokens>`**: Token usage statistics
|
||||
- **`<evaluator.cost>`**: Estimated evaluation cost
|
||||
|
||||
## Best Practices
|
||||
|
||||
|
||||
@@ -2,12 +2,9 @@
|
||||
title: Function
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
The Function block lets you execute custom JavaScript or TypeScript code in your workflows. Use it to transform data, perform calculations, or implement custom logic that isn't available in other blocks.
|
||||
The Function block executes custom JavaScript or TypeScript code in your workflows. Transform data, perform calculations, or implement custom logic.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
@@ -19,107 +16,27 @@ The Function block lets you execute custom JavaScript or TypeScript code in your
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Overview
|
||||
## Outputs
|
||||
|
||||
The Function block enables you to:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Transform data</strong>: Convert formats, parse text, manipulate arrays and objects
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Perform calculations</strong>: Math operations, statistics, financial calculations
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Implement custom logic</strong>: Complex conditionals, loops, and algorithms
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Process external data</strong>: Parse responses, format requests, handle authentication
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## How It Works
|
||||
|
||||
The Function block runs your code in a secure, isolated environment:
|
||||
|
||||
1. **Receive Input**: Access data from previous blocks via the `input` object
|
||||
2. **Execute Code**: Run your JavaScript/Python code
|
||||
3. **Return Results**: Use `return` to pass data to the next block
|
||||
4. **Handle Errors**: Built-in error handling and logging
|
||||
|
||||
## Remote Execution (E2B)
|
||||
|
||||
- **Languages**: Run JavaScript and Python in an isolated E2B sandbox.
|
||||
- **How to enable**: Toggle “Remote Code Execution” in the Function block.
|
||||
- **When to use**: Heavier logic, external libraries, or Python-specific code.
|
||||
- **Performance**: Slower than local JS due to sandbox startup and network overhead.
|
||||
- **Notes**: Requires `E2B_API_KEY` if running locally. For lowest latency, use natively local JS (Fast Mode).
|
||||
|
||||
## Inputs and Outputs
|
||||
|
||||
<Tabs items={['Configuration', 'Variables']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Code</strong>: Your JavaScript/Python code to execute
|
||||
</li>
|
||||
<li>
|
||||
<strong>Timeout</strong>: Maximum execution time (defaults to 30 seconds)
|
||||
</li>
|
||||
<li>
|
||||
<strong>Input Data</strong>: All connected block outputs available via variables
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>function.result</strong>: The value returned from your function
|
||||
</li>
|
||||
<li>
|
||||
<strong>function.stdout</strong>: Console.log() output from your code
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
- **`<function.result>`**: The value returned from your function
|
||||
- **`<function.stdout>`**: Console.log() output from your code
|
||||
|
||||
## Example Use Cases
|
||||
|
||||
### Data Processing Pipeline
|
||||
**Data Processing Pipeline** - Transform API response into structured data
|
||||
```
|
||||
API (Fetch) → Function (Process & Validate) → Function (Calculate Metrics) → Response
|
||||
```
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Transform API response into structured data</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>API block fetches raw customer data</li>
|
||||
<li>Function block processes and validates data</li>
|
||||
<li>Function block calculates derived metrics</li>
|
||||
<li>Response block returns formatted results</li>
|
||||
</ol>
|
||||
</div>
|
||||
**Business Logic Implementation** - Calculate loyalty scores and tiers
|
||||
```
|
||||
Agent (Get History) → Function (Calculate Score) → Function (Determine Tier) → Condition (Route)
|
||||
```
|
||||
|
||||
### Business Logic Implementation
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Calculate loyalty scores and tiers</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Agent retrieves customer purchase history</li>
|
||||
<li>Function block calculates loyalty metrics</li>
|
||||
<li>Function block determines customer tier</li>
|
||||
<li>Condition block routes based on tier level</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Data Validation and Sanitization
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Validate and clean user input</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>User input received from form submission</li>
|
||||
<li>Function block validates email format and phone numbers</li>
|
||||
<li>Function block sanitizes and normalizes data</li>
|
||||
<li>API block saves validated data to database</li>
|
||||
</ol>
|
||||
</div>
|
||||
**Data Validation and Sanitization** - Validate and clean user input
|
||||
```
|
||||
Input → Function (Validate & Sanitize) → API (Save to Database)
|
||||
```
|
||||
|
||||
### Example: Loyalty Score Calculator
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@ title: Guardrails
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
@@ -20,25 +18,6 @@ The Guardrails block validates and protects your AI workflows by checking conten
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Overview
|
||||
|
||||
The Guardrails block enables you to:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Validate JSON Structure</strong>: Ensure LLM outputs are valid JSON before parsing
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Match Regex Patterns</strong>: Verify content matches specific formats (emails, phone numbers, URLs, etc.)
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Detect Hallucinations</strong>: Use RAG + LLM scoring to validate AI outputs against knowledge base content
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Detect PII</strong>: Identify and optionally mask personally identifiable information across 40+ entity types
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Validation Types
|
||||
|
||||
### JSON Validation
|
||||
@@ -106,14 +85,26 @@ Uses Retrieval-Augmented Generation (RAG) with LLM scoring to detect when AI-gen
|
||||
|
||||
Detects personally identifiable information using Microsoft Presidio. Supports 40+ entity types across multiple countries and languages.
|
||||
|
||||
<div className="mx-auto w-3/5 overflow-hidden rounded-lg">
|
||||
<Video src="guardrails.mp4" width={500} height={350} />
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/guardrails-2.png"
|
||||
alt="PII Detection Configuration"
|
||||
width={700}
|
||||
height={450}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
**How It Works:**
|
||||
1. Scans content for PII entities using pattern matching and NLP
|
||||
2. Returns detected entities with locations and confidence scores
|
||||
3. Optionally masks detected PII in the output
|
||||
1. Pass content to validate (e.g., `<agent1.content>`)
|
||||
2. Select PII types to detect using the modal selector
|
||||
3. Choose detection mode (Detect or Mask)
|
||||
4. Content is scanned for matching PII entities
|
||||
5. Returns detection results and optionally masked text
|
||||
|
||||
<div className="mx-auto w-3/5 overflow-hidden rounded-lg">
|
||||
<Video src="guardrails.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
**Configuration:**
|
||||
- **PII Types to Detect**: Select from grouped categories via modal selector
|
||||
@@ -182,57 +173,20 @@ Additional outputs by type:
|
||||
|
||||
## Example Use Cases
|
||||
|
||||
### Validate JSON Before Parsing
|
||||
**Validate JSON Before Parsing** - Ensure Agent output is valid JSON
|
||||
```
|
||||
Agent (Generate) → Guardrails (Validate) → Condition (Check passed) → Function (Parse)
|
||||
```
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Ensure Agent output is valid JSON</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Agent generates structured JSON response</li>
|
||||
<li>Guardrails validates JSON format</li>
|
||||
<li>Condition block checks `<guardrails.passed>`</li>
|
||||
<li>If passed → Parse and use data, If failed → Retry or handle error</li>
|
||||
</ol>
|
||||
</div>
|
||||
**Prevent Hallucinations** - Validate customer support responses against knowledge base
|
||||
```
|
||||
Agent (Response) → Guardrails (Check KB) → Condition (Score ≥ 3) → Send or Flag
|
||||
```
|
||||
|
||||
### Prevent Hallucinations
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Validate customer support responses</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Agent generates response to customer question</li>
|
||||
<li>Guardrails checks against support documentation knowledge base</li>
|
||||
<li>If confidence score ≥ 3 → Send response</li>
|
||||
<li>If confidence score \< 3 → Flag for human review</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Block PII in User Inputs
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Sanitize user-submitted content</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>User submits form with text content</li>
|
||||
<li>Guardrails detects PII (emails, phone numbers, SSN, etc.)</li>
|
||||
<li>If PII detected → Reject submission or mask sensitive data</li>
|
||||
<li>If no PII → Process normally</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div className="mx-auto w-3/5 overflow-hidden rounded-lg">
|
||||
<Video src="guardrails-example.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
### Validate Email Format
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Check email address format</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Agent extracts email from text</li>
|
||||
<li>Guardrails validates with regex pattern</li>
|
||||
<li>If valid → Use email for notification</li>
|
||||
<li>If invalid → Request correction</li>
|
||||
</ol>
|
||||
</div>
|
||||
**Block PII in User Inputs** - Sanitize user-submitted content
|
||||
```
|
||||
Input → Guardrails (Detect PII) → Condition (No PII) → Process or Reject
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
|
||||
172
apps/docs/content/docs/en/blocks/human-in-the-loop.mdx
Normal file
@@ -0,0 +1,172 @@
|
||||
---
|
||||
title: Human in the Loop
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
The Human in the Loop block pauses workflow execution and waits for human intervention before continuing. Use it to add approval gates, collect feedback, or gather additional input at critical decision points.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/hitl-1.png"
|
||||
alt="Human in the Loop Block Configuration"
|
||||
width={500}
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
When execution reaches this block, the workflow pauses indefinitely until a human provides input through the approval portal, API, or webhook.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/hitl-2.png"
|
||||
alt="Human in the Loop Approval Portal"
|
||||
width={700}
|
||||
height={500}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Configuration Options
|
||||
|
||||
### Paused Output
|
||||
|
||||
Defines what data is displayed to the approver. This is the context shown in the approval portal to help them make an informed decision.
|
||||
|
||||
Use the visual builder or JSON editor to structure the data. Reference workflow variables using `<blockName.output>` syntax.
|
||||
|
||||
```json
|
||||
{
|
||||
"customerName": "<agent1.content.name>",
|
||||
"proposedAction": "<router1.selectedPath>",
|
||||
"confidenceScore": "<evaluator1.score>",
|
||||
"generatedEmail": "<agent2.content>"
|
||||
}
|
||||
```
|
||||
|
||||
### Notification
|
||||
|
||||
Configures how approvers are alerted when approval is needed. Supported channels include:
|
||||
|
||||
- **Slack** - Messages to channels or DMs
|
||||
- **Gmail** - Email with approval link
|
||||
- **Microsoft Teams** - Team channel notifications
|
||||
- **SMS** - Text alerts via Twilio
|
||||
- **Webhooks** - Custom notification systems
|
||||
|
||||
Include the approval URL (`<blockId.url>`) in your notification messages so approvers can access the portal.
|
||||
|
||||
### Resume Input
|
||||
|
||||
Defines the fields approvers fill in when responding. This data becomes available to downstream blocks after the workflow resumes.
|
||||
|
||||
```json
|
||||
{
|
||||
"approved": {
|
||||
"type": "boolean",
|
||||
"description": "Approve or reject this request"
|
||||
},
|
||||
"comments": {
|
||||
"type": "string",
|
||||
"description": "Optional feedback or explanation"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Access resume data in downstream blocks using `<blockId.resumeInput.fieldName>`.
|
||||
|
||||
## Approval Methods
|
||||
|
||||
<Tabs items={['Approval Portal', 'API', 'Webhook']}>
|
||||
<Tab>
|
||||
### Approval Portal
|
||||
|
||||
Every block generates a unique portal URL (`<blockId.url>`) with a visual interface showing all paused output data and form fields for resume input. Mobile-responsive and secure.
|
||||
|
||||
Share this URL in notifications for approvers to review and respond.
|
||||
</Tab>
|
||||
<Tab>
|
||||
### REST API
|
||||
|
||||
Programmatically resume workflows:
|
||||
|
||||
```bash
|
||||
POST /api/workflows/{workflowId}/executions/{executionId}/resume/{blockId}
|
||||
|
||||
{
|
||||
"approved": true,
|
||||
"comments": "Looks good to proceed"
|
||||
}
|
||||
```
|
||||
|
||||
Build custom approval UIs or integrate with existing systems.
|
||||
</Tab>
|
||||
<Tab>
|
||||
### Webhook
|
||||
|
||||
Add a webhook tool to the Notification section to send approval requests to external systems. Integrate with ticketing systems like Jira or ServiceNow.
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Common Use Cases
|
||||
|
||||
**Content Approval** - Review AI-generated content before publishing
|
||||
```
|
||||
Agent → Human in the Loop → API (Publish)
|
||||
```
|
||||
|
||||
**Multi-Stage Approvals** - Chain multiple approval steps for high-stakes decisions
|
||||
```
|
||||
Agent → Human in the Loop (Manager) → Human in the Loop (Director) → Execute
|
||||
```
|
||||
|
||||
**Data Validation** - Verify extracted data before processing
|
||||
```
|
||||
Agent (Extract) → Human in the Loop (Validate) → Function (Process)
|
||||
```
|
||||
|
||||
**Quality Control** - Review AI outputs before sending to customers
|
||||
```
|
||||
Agent (Generate) → Human in the Loop (QA) → Gmail (Send)
|
||||
```
|
||||
|
||||
## Block Outputs
|
||||
|
||||
**`url`** - Unique URL for the approval portal
|
||||
**`resumeInput.*`** - All fields defined in Resume Input become available after the workflow resumes
|
||||
|
||||
Access using `<blockId.resumeInput.fieldName>`.
|
||||
|
||||
## Example
|
||||
|
||||
**Paused Output:**
|
||||
```json
|
||||
{
|
||||
"title": "<agent1.content.title>",
|
||||
"body": "<agent1.content.body>",
|
||||
"qualityScore": "<evaluator1.score>"
|
||||
}
|
||||
```
|
||||
|
||||
**Resume Input:**
|
||||
```json
|
||||
{
|
||||
"approved": { "type": "boolean" },
|
||||
"feedback": { "type": "string" }
|
||||
}
|
||||
```
|
||||
|
||||
**Downstream Usage:**
|
||||
```javascript
|
||||
// Condition block
|
||||
<approval1.resumeInput.approved> === true
|
||||
```
|
||||
|
||||
## Related Blocks
|
||||
|
||||
- **[Condition](/blocks/condition)** - Branch based on approval decisions
|
||||
- **[Variables](/blocks/variables)** - Store approval history and metadata
|
||||
- **[Response](/blocks/response)** - Return workflow results to API callers
|
||||
@@ -31,6 +31,7 @@ Sim provides essential block types that handle the core functions of AI workflow
|
||||
### Control Flow Blocks
|
||||
- **[Variables](/blocks/variables)** - Set and manage workflow-scoped variables
|
||||
- **[Wait](/blocks/wait)** - Pause workflow execution for a specified time delay
|
||||
- **[Human in the Loop](/blocks/human-in-the-loop)** - Pause for human approval and feedback before continuing
|
||||
|
||||
### Output Blocks
|
||||
- **[Response](/blocks/response)** - Format and return final results from your workflow
|
||||
@@ -127,6 +128,9 @@ Each block type has specific configuration options:
|
||||
<Card title="Condition Block" href="/blocks/condition">
|
||||
Create branching logic based on data evaluation
|
||||
</Card>
|
||||
<Card title="Human in the Loop Block" href="/blocks/human-in-the-loop">
|
||||
Pause for human approval and feedback before continuing
|
||||
</Card>
|
||||
<Card title="Variables Block" href="/blocks/variables">
|
||||
Set and manage workflow-scoped variables
|
||||
</Card>
|
||||
|
||||
@@ -3,46 +3,15 @@ title: Loop
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
The Loop block is a container block in Sim that allows you to create iterative workflows by executing a group of blocks repeatedly. Loops enable iterative processing in your workflows.
|
||||
|
||||
The Loop block supports four types of iteration:
|
||||
The Loop block is a container that executes blocks repeatedly. Iterate over collections, repeat operations a fixed number of times, or continue while a condition is met.
|
||||
|
||||
<Callout type="info">
|
||||
Loop blocks are container nodes that can hold other blocks inside them. The blocks inside a loop will execute multiple times based on your configuration.
|
||||
Loop blocks are container nodes that hold other blocks inside them. The contained blocks execute multiple times based on your configuration.
|
||||
</Callout>
|
||||
|
||||
## Overview
|
||||
|
||||
The Loop block enables you to:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Iterate over collections</strong>: Process arrays or objects one item at a time
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Repeat operations</strong>: Execute blocks a fixed number of times
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Loop on conditions</strong>: Continue executing while or until a condition is met
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Aggregate results</strong>: Collect outputs from all loop iterations
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## How It Works
|
||||
|
||||
The Loop block executes contained blocks through sequential iteration:
|
||||
|
||||
1. **Initialize Loop** - Set up iteration parameters (count or collection)
|
||||
2. **Execute Iteration** - Run contained blocks for current iteration
|
||||
3. **Collect Results** - Store output from each iteration
|
||||
4. **Continue or Complete** - Move to next iteration or finish loop
|
||||
|
||||
## Configuration Options
|
||||
|
||||
### Loop Type
|
||||
@@ -125,7 +94,7 @@ Choose between four types of loops:
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/loop-3.png"
|
||||
src="/static/blocks/loop-4.png"
|
||||
alt="Do-While Loop with condition"
|
||||
width={500}
|
||||
height={400}
|
||||
@@ -163,42 +132,20 @@ After a loop completes, you can access aggregated results:
|
||||
|
||||
## Example Use Cases
|
||||
|
||||
### Processing API Results
|
||||
**Processing API Results** - ForEach loop processes customer records from an API
|
||||
```
|
||||
API (Fetch) → Loop (ForEach) → Agent (Analyze) → Function (Store)
|
||||
```
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Process multiple customer records</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>API block fetches customer list</li>
|
||||
<li>ForEach loop iterates over each customer</li>
|
||||
<li>Inside loop: Agent analyzes customer data</li>
|
||||
<li>Inside loop: Function stores analysis results</li>
|
||||
</ol>
|
||||
</div>
|
||||
**Iterative Content Generation** - For loop generates multiple content variations
|
||||
```
|
||||
Loop (5x) → Agent (Generate) → Evaluator (Score) → Function (Select Best)
|
||||
```
|
||||
|
||||
### Iterative Content Generation
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Generate multiple variations</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Set For loop to 5 iterations</li>
|
||||
<li>Inside loop: Agent generates content variation</li>
|
||||
<li>Inside loop: Evaluator scores the content</li>
|
||||
<li>After loop: Function selects best variation</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Counter with While Loop
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Process items with counter-based loop</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Initialize workflow variable: `i = 0`</li>
|
||||
<li>While loop with condition: `<variable.i>` \< 10</li>
|
||||
<li>Inside loop: Agent processes item at index `<variable.i>`</li>
|
||||
<li>Inside loop: Variables increments `i = <variable.i> + 1`</li>
|
||||
<li>Loop continues while i is less than 10</li>
|
||||
</ol>
|
||||
</div>
|
||||
**Counter with While Loop** - While loop processes items with counter
|
||||
```
|
||||
Variables (i=0) → Loop (While i<10) → Agent (Process) → Variables (i++)
|
||||
```
|
||||
|
||||
## Advanced Features
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"evaluator",
|
||||
"function",
|
||||
"guardrails",
|
||||
"human-in-the-loop",
|
||||
"loop",
|
||||
"parallel",
|
||||
"response",
|
||||
|
||||
@@ -3,37 +3,15 @@ title: Parallel
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
The Parallel block is a container block in Sim that allows you to execute multiple instances of blocks concurrently for faster workflow processing.
|
||||
|
||||
The Parallel block supports two types of concurrent execution:
|
||||
The Parallel block is a container that executes multiple instances concurrently for faster workflow processing. Process items simultaneously instead of sequentially.
|
||||
|
||||
<Callout type="info">
|
||||
Parallel blocks are container nodes that execute their contents multiple times simultaneously, unlike loops which execute sequentially.
|
||||
</Callout>
|
||||
|
||||
## Overview
|
||||
|
||||
The Parallel block enables you to:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Distribute work</strong>: Process multiple items concurrently
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Speed up execution</strong>: Run independent operations simultaneously
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Handle bulk operations</strong>: Process large datasets efficiently
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Aggregate results</strong>: Collect outputs from all parallel executions
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Configuration Options
|
||||
|
||||
### Parallel Type
|
||||
@@ -106,27 +84,15 @@ After a parallel block completes, you can access aggregated results:
|
||||
|
||||
## Example Use Cases
|
||||
|
||||
### Batch API Processing
|
||||
**Batch API Processing** - Process multiple API calls simultaneously
|
||||
```
|
||||
Parallel (Collection) → API (Call Endpoint) → Function (Aggregate)
|
||||
```
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Process multiple API calls simultaneously</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Parallel block with collection of API endpoints</li>
|
||||
<li>Inside parallel: API block calls each endpoint</li>
|
||||
<li>After parallel: Process all responses together</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Multi-Model AI Processing
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Get responses from multiple AI models</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Collection-based parallel over a list of model IDs (e.g., ["gpt-4o", "claude-3.7-sonnet", "gemini-2.5-pro"])</li>
|
||||
<li>Inside parallel: Agent's model is set to the current item from the collection</li>
|
||||
<li>After parallel: Compare and select best response</li>
|
||||
</ol>
|
||||
</div>
|
||||
**Multi-Model AI Processing** - Get responses from multiple AI models concurrently
|
||||
```
|
||||
Parallel (["gpt-4o", "claude-3.7-sonnet", "gemini-2.5-pro"]) → Agent → Evaluator (Select Best)
|
||||
```
|
||||
|
||||
## Advanced Features
|
||||
|
||||
|
||||
@@ -3,11 +3,10 @@ title: Response
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
The Response block is the final step in your workflow that formats and sends a structured response back to API calls. It's like the "return" statement for your entire workflow—it packages up results and sends them back.
|
||||
The Response block formats and sends structured HTTP responses back to API callers. Use it to return workflow results with proper status codes and headers.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
@@ -20,57 +19,9 @@ The Response block is the final step in your workflow that formats and sends a s
|
||||
</div>
|
||||
|
||||
<Callout type="info">
|
||||
Response blocks are terminal blocks - they end the workflow execution and cannot connect to other blocks.
|
||||
Response blocks are terminal blocks - they end workflow execution and cannot connect to other blocks.
|
||||
</Callout>
|
||||
|
||||
## Overview
|
||||
|
||||
The Response block enables you to:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Format API Responses</strong>: Structure workflow results into proper HTTP responses
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Set Status Codes</strong>: Configure appropriate HTTP status codes based on workflow outcomes
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Control Headers</strong>: Add custom headers for API responses and webhooks
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Transform Data</strong>: Convert workflow variables into client-friendly response formats
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## How It Works
|
||||
|
||||
The Response block finalizes workflow execution:
|
||||
|
||||
1. **Collect Data** - Gathers variables and outputs from previous blocks
|
||||
2. **Format Response** - Structures data according to your configuration
|
||||
3. **Set HTTP Details** - Applies status codes and headers
|
||||
4. **Send Response** - Returns the formatted response to the API caller
|
||||
|
||||
## When You Need Response Blocks
|
||||
|
||||
- **API Endpoints**: When your workflow is called via API, Response blocks format the return data
|
||||
- **Webhooks**: Return confirmation or data back to the calling system
|
||||
- **Testing**: See formatted results when testing your workflow
|
||||
|
||||
## Two Ways to Build Responses
|
||||
|
||||
### Builder Mode (Recommended)
|
||||
Visual interface for building response structure:
|
||||
- Drag and drop fields
|
||||
- Reference workflow variables easily
|
||||
- Visual preview of response structure
|
||||
|
||||
### Editor Mode (Advanced)
|
||||
Write JSON directly:
|
||||
- Full control over response format
|
||||
- Support for complex nested structures
|
||||
- Use `<variable.name>` syntax for dynamic values
|
||||
|
||||
## Configuration Options
|
||||
|
||||
### Response Data
|
||||
@@ -84,36 +35,23 @@ The response data is the main content that will be sent back to the API caller.
|
||||
|
||||
### Status Code
|
||||
|
||||
Set the HTTP status code for the response. Common status codes include:
|
||||
Set the HTTP status code for the response (defaults to 200):
|
||||
|
||||
<Tabs items={['Success (2xx)', 'Client Error (4xx)', 'Server Error (5xx)']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li><strong>200</strong>: OK - Standard success response</li>
|
||||
<li><strong>201</strong>: Created - Resource successfully created</li>
|
||||
<li><strong>204</strong>: No Content - Success with no response body</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li><strong>400</strong>: Bad Request - Invalid request parameters</li>
|
||||
<li><strong>401</strong>: Unauthorized - Authentication required</li>
|
||||
<li><strong>404</strong>: Not Found - Resource doesn't exist</li>
|
||||
<li><strong>422</strong>: Unprocessable Entity - Validation errors</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li><strong>500</strong>: Internal Server Error - Server-side error</li>
|
||||
<li><strong>502</strong>: Bad Gateway - External service error</li>
|
||||
<li><strong>503</strong>: Service Unavailable - Service temporarily down</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
**Success (2xx):**
|
||||
- **200**: OK - Standard success response
|
||||
- **201**: Created - Resource successfully created
|
||||
- **204**: No Content - Success with no response body
|
||||
|
||||
<div className="mt-4 text-sm text-gray-600 dark:text-gray-400">
|
||||
Default status code is 200 if not specified.
|
||||
</div>
|
||||
**Client Error (4xx):**
|
||||
- **400**: Bad Request - Invalid request parameters
|
||||
- **401**: Unauthorized - Authentication required
|
||||
- **404**: Not Found - Resource doesn't exist
|
||||
- **422**: Unprocessable Entity - Validation errors
|
||||
|
||||
**Server Error (5xx):**
|
||||
- **500**: Internal Server Error - Server-side error
|
||||
- **502**: Bad Gateway - External service error
|
||||
- **503**: Service Unavailable - Service temporarily down
|
||||
|
||||
### Response Headers
|
||||
|
||||
@@ -129,91 +67,24 @@ Headers are configured as key-value pairs:
|
||||
|
||||
## Example Use Cases
|
||||
|
||||
### API Endpoint Response
|
||||
**API Endpoint Response** - Return structured data from a search API
|
||||
```
|
||||
Agent (Search) → Function (Format & Paginate) → Response (200, JSON)
|
||||
```
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Return structured data from a search API</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Workflow processes search query and retrieves results</li>
|
||||
<li>Function block formats and paginates results</li>
|
||||
<li>Response block returns JSON with data, pagination, and metadata</li>
|
||||
<li>Client receives structured response with 200 status</li>
|
||||
</ol>
|
||||
</div>
|
||||
**Webhook Confirmation** - Acknowledge webhook receipt and processing
|
||||
```
|
||||
Webhook Trigger → Function (Process) → Response (200, Confirmation)
|
||||
```
|
||||
|
||||
### Webhook Confirmation
|
||||
**Error Response Handling** - Return appropriate error responses
|
||||
```
|
||||
Condition (Error Detected) → Router → Response (400/500, Error Details)
|
||||
```
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Acknowledge webhook receipt and processing</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Webhook trigger receives external system data</li>
|
||||
<li>Workflow processes the incoming data</li>
|
||||
<li>Response block returns confirmation with processing status</li>
|
||||
<li>External system receives acknowledgment</li>
|
||||
</ol>
|
||||
</div>
|
||||
## Outputs
|
||||
|
||||
### Error Response Handling
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Return appropriate error responses</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Condition block detects validation failure or system error</li>
|
||||
<li>Router directs to error handling path</li>
|
||||
<li>Response block returns 400/500 status with error details</li>
|
||||
<li>Client receives structured error information</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
## Inputs and Outputs
|
||||
|
||||
<Tabs items={['Configuration', 'Variables', 'Results']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Response Data</strong>: JSON structure for response body
|
||||
</li>
|
||||
<li>
|
||||
<strong>Status Code</strong>: HTTP status code (default: 200)
|
||||
</li>
|
||||
<li>
|
||||
<strong>Headers</strong>: Custom HTTP headers as key-value pairs
|
||||
</li>
|
||||
<li>
|
||||
<strong>Mode</strong>: Builder or Editor mode for response construction
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>response.data</strong>: The structured response body
|
||||
</li>
|
||||
<li>
|
||||
<strong>response.status</strong>: HTTP status code sent
|
||||
</li>
|
||||
<li>
|
||||
<strong>response.headers</strong>: Headers included in response
|
||||
</li>
|
||||
<li>
|
||||
<strong>response.success</strong>: Boolean indicating successful completion
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>HTTP Response</strong>: Complete response sent to API caller
|
||||
</li>
|
||||
<li>
|
||||
<strong>Workflow Termination</strong>: Ends workflow execution
|
||||
</li>
|
||||
<li>
|
||||
<strong>Access</strong>: Response blocks are terminal - no subsequent blocks
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
Response blocks are terminal - they end workflow execution and send the HTTP response to the API caller. No outputs are available to downstream blocks.
|
||||
|
||||
## Variable References
|
||||
|
||||
|
||||
@@ -3,13 +3,10 @@ title: Router
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Accordion, Accordions } from 'fumadocs-ui/components/accordion'
|
||||
import { Image } from '@/components/ui/image'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
The Router block uses AI to intelligently decide which path your workflow should take next, routing workflow execution based on specific conditions or logic. Unlike Condition blocks that use simple rules, Router blocks can understand context and make smart routing decisions based on content analysis.
|
||||
The Router block uses AI to intelligently route workflows based on content analysis. Unlike Condition blocks that use simple rules, Routers understand context and intent.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
@@ -21,60 +18,17 @@ The Router block uses AI to intelligently decide which path your workflow should
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Overview
|
||||
## Router vs Condition
|
||||
|
||||
The Router block enables you to:
|
||||
**Use Router when:**
|
||||
- AI-powered content analysis is needed
|
||||
- Working with unstructured or varying content
|
||||
- Intent-based routing is required (e.g., "route support tickets to departments")
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Intelligent content routing</strong>: Use AI to understand intent and context
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Dynamic path selection</strong>: Route workflows based on unstructured content analysis
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Context-aware decisions</strong>: Make smart routing choices beyond simple rules
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Multi-path management</strong>: Handle complex workflows with multiple potential destinations
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Router vs Condition Blocks
|
||||
|
||||
<Accordions>
|
||||
<Accordion title="When to Use Router">
|
||||
- AI-powered content analysis needed
|
||||
- Unstructured or varying content types
|
||||
- Intent-based routing (e.g., "route support tickets to departments")
|
||||
- Context-aware decision making required
|
||||
</Accordion>
|
||||
<Accordion title="When to Use Condition">
|
||||
- Simple, rule-based decisions
|
||||
- Structured data or numeric comparisons
|
||||
- Fast, deterministic routing needed
|
||||
- Boolean logic sufficient
|
||||
</Accordion>
|
||||
</Accordions>
|
||||
|
||||
## How It Works
|
||||
|
||||
The Router block:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Analyze content</strong>: Uses an LLM to understand input content and context
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Evaluate targets</strong>: Compares content against available destination blocks
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Select destination</strong>: Identifies the most appropriate path based on intent
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Route execution</strong>: Directs workflow to the selected block
|
||||
</Step>
|
||||
</Steps>
|
||||
**Use Condition when:**
|
||||
- Simple rule-based decisions are sufficient
|
||||
- Working with structured data or numeric comparisons
|
||||
- Fast, deterministic routing is needed
|
||||
|
||||
## Configuration Options
|
||||
|
||||
@@ -98,122 +52,42 @@ The possible destination blocks that the Router can select from. The Router will
|
||||
|
||||
Choose an AI model to power the routing decision:
|
||||
|
||||
**OpenAI**: GPT-4o, o1, o3, o4-mini, gpt-4.1 \
|
||||
**Anthropic**: Claude 3.7 Sonnet \
|
||||
**Google**: Gemini 2.5 Pro, Gemini 2.0 Flash \
|
||||
**Other Providers**: Groq, Cerebras, xAI, DeepSeek \
|
||||
**Local Models**: Any model running on Ollama
|
||||
- **OpenAI**: GPT-4o, o1, o3, o4-mini, gpt-4.1
|
||||
- **Anthropic**: Claude 3.7 Sonnet
|
||||
- **Google**: Gemini 2.5 Pro, Gemini 2.0 Flash
|
||||
- **Other Providers**: Groq, Cerebras, xAI, DeepSeek
|
||||
- **Local Models**: Ollama-compatible models
|
||||
|
||||
<div className="w-full max-w-2xl mx-auto overflow-hidden rounded-lg">
|
||||
<Video src="router-model-dropdown.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
**Recommendation**: Use models with strong reasoning capabilities like GPT-4o or Claude 3.7 Sonnet for more accurate routing decisions.
|
||||
Use models with strong reasoning capabilities like GPT-4o or Claude 3.7 Sonnet for best results.
|
||||
|
||||
### API Key
|
||||
|
||||
Your API key for the selected LLM provider. This is securely stored and used for authentication.
|
||||
|
||||
### Accessing Results
|
||||
## Outputs
|
||||
|
||||
After a router makes a decision, you can access its outputs:
|
||||
|
||||
- **`<router.prompt>`**: Summary of the routing prompt used
|
||||
- **`<router.selected_path>`**: Details of the chosen destination block
|
||||
- **`<router.tokens>`**: Token usage statistics from the LLM
|
||||
- **`<router.cost>`**: Cost summary for the routing call (input, output, total)
|
||||
- **`<router.model>`**: The model used for decision-making
|
||||
|
||||
## Advanced Features
|
||||
|
||||
### Custom Routing Criteria
|
||||
|
||||
Define specific criteria for each target block:
|
||||
|
||||
```javascript
|
||||
// Example routing descriptions
|
||||
Target Block 1: "Technical support issues, API problems, integration questions"
|
||||
Target Block 2: "Billing inquiries, subscription changes, payment issues"
|
||||
Target Block 3: "General questions, feedback, feature requests"
|
||||
```
|
||||
|
||||
## Inputs and Outputs
|
||||
|
||||
<Tabs items={['Configuration', 'Variables']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Content/Prompt</strong>: Text to analyze for routing decisions
|
||||
</li>
|
||||
<li>
|
||||
<strong>Target Blocks</strong>: Connected blocks as potential destinations
|
||||
</li>
|
||||
<li>
|
||||
<strong>Model</strong>: AI model for routing analysis
|
||||
</li>
|
||||
<li>
|
||||
<strong>API Key</strong>: Authentication for selected LLM provider
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>router.prompt</strong>: Summary of routing prompt used
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.selected_path</strong>: Details of chosen destination
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.tokens</strong>: Token usage statistics
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.cost</strong>: Cost summary for the routing call (input, output, total)
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.model</strong>: Model used for decision-making
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
- **`<router.prompt>`**: Summary of the routing prompt
|
||||
- **`<router.selected_path>`**: Chosen destination block
|
||||
- **`<router.tokens>`**: Token usage statistics
|
||||
- **`<router.cost>`**: Estimated routing cost
|
||||
- **`<router.model>`**: Model used for decision-making
|
||||
|
||||
## Example Use Cases
|
||||
|
||||
### Customer Support Triage
|
||||
**Customer Support Triage** - Route tickets to specialized departments
|
||||
```
|
||||
Input (Ticket) → Router → Agent (Engineering) or Agent (Finance)
|
||||
```
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Route support tickets to specialized departments</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>User submits support request via form</li>
|
||||
<li>Router analyzes ticket content and context</li>
|
||||
<li>Technical issues → Engineering support agent</li>
|
||||
<li>Billing questions → Finance support agent</li>
|
||||
</ol>
|
||||
</div>
|
||||
**Content Classification** - Classify and route user-generated content
|
||||
```
|
||||
Input (Feedback) → Router → Workflow (Product) or Workflow (Technical)
|
||||
```
|
||||
|
||||
### Content Classification
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Classify and route user-generated content</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>User submits content or feedback</li>
|
||||
<li>Router analyzes content type and sentiment</li>
|
||||
<li>Feature requests → Product team workflow</li>
|
||||
<li>Bug reports → Technical support workflow</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Lead Qualification
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Route leads based on qualification criteria</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Lead information captured from form</li>
|
||||
<li>Router analyzes company size, industry, and needs</li>
|
||||
<li>Enterprise leads → Sales team with custom pricing</li>
|
||||
<li>SMB leads → Self-service onboarding flow</li>
|
||||
</ol>
|
||||
</div>
|
||||
**Lead Qualification** - Route leads based on qualification criteria
|
||||
```
|
||||
Input (Lead) → Router → Agent (Enterprise Sales) or Workflow (Self-serve)
|
||||
```
|
||||
|
||||
|
||||
## Best Practices
|
||||
|
||||
@@ -22,22 +22,6 @@ The Variables block updates workflow variables during execution. Variables must
|
||||
Access variables anywhere in your workflow using `<variable.variableName>` syntax.
|
||||
</Callout>
|
||||
|
||||
## Overview
|
||||
|
||||
The Variables block enables you to:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Update workflow variables</strong>: Change variable values during execution
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Store dynamic data</strong>: Capture block outputs into variables
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Maintain state</strong>: Track counters, flags, and intermediate results
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## How to Use Variables
|
||||
|
||||
### 1. Initialize in Workflow Variables
|
||||
@@ -72,44 +56,20 @@ API body: {"status": "<variable.currentStatus>"}
|
||||
|
||||
## Example Use Cases
|
||||
|
||||
### Loop Counter and State
|
||||
**Loop Counter and State** - Track progress through iterations
|
||||
```
|
||||
Loop → Agent (Process) → Variables (itemsProcessed + 1) → Variables (Store lastResult)
|
||||
```
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Track progress through loop iterations</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Initialize in workflow: `itemsProcessed = 0`, `lastResult = ""`</li>
|
||||
<li>Loop iterates over items</li>
|
||||
<li>Inside loop: Agent processes current item</li>
|
||||
<li>Inside loop: Variables updates `itemsProcessed = <variable.itemsProcessed> + 1`</li>
|
||||
<li>Inside loop: Variables updates `lastResult = <agent.content>`</li>
|
||||
<li>Next iteration: Access `<variable.lastResult>` to compare with current result</li>
|
||||
</ol>
|
||||
</div>
|
||||
**Retry Logic** - Track API retry attempts
|
||||
```
|
||||
API (Try) → Variables (retryCount + 1) → Condition (retryCount < 3)
|
||||
```
|
||||
|
||||
### Retry Logic
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Track API retry attempts</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Initialize in workflow: `retryCount = 0`</li>
|
||||
<li>API block attempts request</li>
|
||||
<li>If failed, Variables increments: `retryCount = <variable.retryCount> + 1`</li>
|
||||
<li>Condition checks if `<variable.retryCount>` \< 3 to retry or fail</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Dynamic Configuration
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Store user context for workflow</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Initialize in workflow: `userId = ""`, `userTier = ""`</li>
|
||||
<li>API fetches user profile</li>
|
||||
<li>Variables stores: `userId = <api.id>`, `userTier = <api.tier>`</li>
|
||||
<li>Agent personalizes response using `<variable.userTier>`</li>
|
||||
<li>API uses `<variable.userId>` for logging</li>
|
||||
</ol>
|
||||
</div>
|
||||
**Dynamic Configuration** - Store user context for workflow
|
||||
```
|
||||
API (Fetch Profile) → Variables (userId, userTier) → Agent (Personalize)
|
||||
```
|
||||
|
||||
## Outputs
|
||||
|
||||
|
||||
@@ -18,22 +18,6 @@ The Wait block pauses your workflow for a specified amount of time before contin
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Overview
|
||||
|
||||
The Wait block enables you to:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Add time delays</strong>: Pause execution between workflow steps
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Respect rate limits</strong>: Space out API calls to stay within limits
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Schedule sequences</strong>: Create timed workflows with delays between actions
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Configuration
|
||||
|
||||
### Wait Amount
|
||||
@@ -59,39 +43,20 @@ Choose the time unit:
|
||||
|
||||
## Example Use Cases
|
||||
|
||||
### API Rate Limiting
|
||||
**API Rate Limiting** - Stay within API rate limits between requests
|
||||
```
|
||||
API (Request 1) → Wait (2s) → API (Request 2)
|
||||
```
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Stay within API rate limits</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>API block makes first request</li>
|
||||
<li>Wait block pauses for 2 seconds</li>
|
||||
<li>API block makes second request</li>
|
||||
<li>Process continues without hitting rate limits</li>
|
||||
</ol>
|
||||
</div>
|
||||
**Timed Notifications** - Send follow-up messages after a delay
|
||||
```
|
||||
Function (Send Email) → Wait (5min) → Function (Follow-up)
|
||||
```
|
||||
|
||||
### Timed Notifications
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Send follow-up messages</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>Function sends initial email</li>
|
||||
<li>Wait block pauses for 5 minutes</li>
|
||||
<li>Function sends follow-up email</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
### Processing Delays
|
||||
|
||||
<div className="mb-4 rounded-md border p-4">
|
||||
<h4 className="font-medium">Scenario: Wait for external system</h4>
|
||||
<ol className="list-decimal pl-5 text-sm">
|
||||
<li>API block triggers job in external system</li>
|
||||
<li>Wait block pauses for 30 seconds</li>
|
||||
<li>API block checks job completion status</li>
|
||||
</ol>
|
||||
</div>
|
||||
**Processing Delays** - Wait for external system to complete processing
|
||||
```
|
||||
API (Trigger Job) → Wait (30s) → API (Check Status)
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
|
||||
@@ -23,9 +23,20 @@ Drop a Workflow block when you want to call a child workflow as part of a larger
|
||||
## Configure It
|
||||
|
||||
1. **Pick a workflow** from the dropdown (self-references are blocked to prevent loops).
|
||||
2. **Map inputs**: If the child workflow has an Input Form trigger, you’ll see each field and can connect parent variables. The mapped values are what the child receives.
|
||||
2. **Map inputs**: If the child workflow has an Input Form trigger, you'll see each field and can connect parent variables. The mapped values are what the child receives.
|
||||
|
||||
<div className='flex justify-center my-6'>
|
||||
<Image
|
||||
src='/static/blocks/workflow-2.png'
|
||||
alt='Workflow block with input mapping example'
|
||||
width={700}
|
||||
height={400}
|
||||
className='rounded-xl border border-border shadow-sm'
|
||||
/>
|
||||
</div>
|
||||
|
||||
3. **Outputs**: After the child finishes, the block exposes:
|
||||
- `result` – the child workflow’s final response
|
||||
- `result` – the child workflow's final response
|
||||
- `success` – whether it ran without errors
|
||||
- `error` – message when the run fails
|
||||
|
||||
|
||||
@@ -2,10 +2,8 @@
|
||||
title: External API
|
||||
---
|
||||
|
||||
import { Accordion, Accordions } from 'fumadocs-ui/components/accordion'
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { CodeBlock } from 'fumadocs-ui/components/codeblock'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
Sim provides a comprehensive external API for querying workflow execution logs and setting up webhooks for real-time notifications when workflows complete.
|
||||
|
||||
@@ -4,9 +4,7 @@ title: Basics
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Card, Cards } from 'fumadocs-ui/components/card'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Image } from '@/components/ui/image'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
Understanding how workflows execute in Sim is key to building efficient and reliable automations. The execution engine automatically handles dependencies, concurrency, and data flow to ensure your workflows run smoothly and predictably.
|
||||
|
||||
@@ -77,29 +75,6 @@ Sim provides different types of blocks that serve specific purposes in your work
|
||||
|
||||
All blocks execute automatically based on their dependencies - you don't need to manually manage execution order or timing.
|
||||
|
||||
## Execution Triggers
|
||||
|
||||
Workflows can be triggered in several ways, depending on your use case:
|
||||
|
||||
### Manual Testing
|
||||
Click "Run" in the workflow editor to test your workflow during development. Perfect for debugging and validation.
|
||||
|
||||
### Scheduled Execution
|
||||
Set up recurring executions using cron expressions. Great for regular data processing, reports, or maintenance tasks.
|
||||
|
||||
### API Deployment
|
||||
Deploy workflows as HTTP endpoints that can be called programmatically from your applications.
|
||||
|
||||
### Webhook Integration
|
||||
Respond to events from external services like GitHub, Stripe, or custom systems in real-time.
|
||||
|
||||
### Chat Interface
|
||||
Create conversational interfaces hosted on custom subdomains for user-facing AI applications.
|
||||
|
||||
<Callout type="info">
|
||||
Learn more about each trigger type in the [Triggers section](/triggers) of the documentation.
|
||||
</Callout>
|
||||
|
||||
## Execution Monitoring
|
||||
|
||||
When workflows run, Sim provides real-time visibility into the execution process:
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
title: Cost Calculation
|
||||
---
|
||||
|
||||
import { Accordion, Accordions } from 'fumadocs-ui/components/accordion'
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
@@ -85,27 +84,11 @@ The model breakdown shows:
|
||||
|
||||
## Cost Optimization Strategies
|
||||
|
||||
<Accordions>
|
||||
<Accordion title="Model Selection">
|
||||
Choose models based on task complexity. Simple tasks can use GPT-4.1-nano ($0.10/$0.40) while complex reasoning might need o1 or Claude Opus.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Prompt Engineering">
|
||||
Well-structured, concise prompts reduce token usage without sacrificing quality.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Local Models">
|
||||
Use Ollama for non-critical tasks to eliminate API costs entirely.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Caching and Reuse">
|
||||
Store frequently used results in variables or files to avoid repeated AI model calls.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Batch Processing">
|
||||
Process multiple items in a single AI request rather than making individual calls.
|
||||
</Accordion>
|
||||
</Accordions>
|
||||
- **Model Selection**: Choose models based on task complexity. Simple tasks can use GPT-4.1-nano while complex reasoning might need o1 or Claude Opus.
|
||||
- **Prompt Engineering**: Well-structured, concise prompts reduce token usage without sacrificing quality.
|
||||
- **Local Models**: Use Ollama for non-critical tasks to eliminate API costs entirely.
|
||||
- **Caching and Reuse**: Store frequently used results in variables or files to avoid repeated AI model calls.
|
||||
- **Batch Processing**: Process multiple items in a single AI request rather than making individual calls.
|
||||
|
||||
## Usage Monitoring
|
||||
|
||||
|
||||
@@ -52,42 +52,6 @@ Each workflow maintains a rich context during execution containing:
|
||||
- Environment variables
|
||||
- Routing decisions
|
||||
|
||||
## Execution Triggers
|
||||
|
||||
Workflows can be executed through multiple channels:
|
||||
|
||||
- **Manual**: Test and debug directly in the editor
|
||||
- **Deploy as API**: Create an HTTP endpoint secured with API keys
|
||||
- **Deploy as Chat**: Create a conversational interface on a custom subdomain
|
||||
- **Webhooks**: Respond to external events from third-party services
|
||||
- **Scheduled**: Run on a recurring schedule using cron expressions
|
||||
|
||||
### Deploy as API
|
||||
|
||||
When you deploy a workflow as an API, Sim:
|
||||
- Creates a unique HTTP endpoint: `https://sim.ai/api/workflows/{workflowId}/execute`
|
||||
- Generates an API key for authentication
|
||||
- Accepts POST requests with JSON payloads
|
||||
- Returns workflow execution results as JSON
|
||||
|
||||
Example API call:
|
||||
```bash
|
||||
curl -X POST https://sim.ai/api/workflows/your-workflow-id/execute \
|
||||
-H "X-API-Key: your-api-key" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"input": "your data here"}'
|
||||
```
|
||||
|
||||
### Deploy as Chat
|
||||
|
||||
Chat deployment creates a conversational interface for your workflow:
|
||||
- Hosted on a custom subdomain: `https://your-name.sim.ai`
|
||||
- Optional authentication (public, password, or email-based)
|
||||
- Customizable UI with your branding
|
||||
- Streaming responses for real-time interaction
|
||||
- Perfect for AI assistants, support bots, or interactive tools
|
||||
|
||||
Each deployment method passes data to your workflow's starter block, beginning the execution flow.
|
||||
|
||||
## Deployment Snapshots
|
||||
|
||||
@@ -95,7 +59,7 @@ All public entry points—API, Chat, Schedule, Webhook, and Manual runs—execut
|
||||
|
||||
<div className='flex justify-center my-6'>
|
||||
<Image
|
||||
src='/static/execution/deployment-versions-light.png'
|
||||
src='/static/execution/deployment-versions.png'
|
||||
alt='Deployment versions table'
|
||||
width={500}
|
||||
height={280}
|
||||
|
||||
@@ -24,20 +24,19 @@ import {
|
||||
import { Video } from '@/components/ui/video'
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
This tutorial will guide you through building your first AI workflow in Sim. We'll create a people research agent that can find information about individuals using state-of-the-art LLM-Search tools.
|
||||
Build your first AI workflow in 10 minutes. In this tutorial, you'll create a people research agent that uses advanced LLM-powered search tools to extract and structure information about individuals.
|
||||
|
||||
<Callout type="info">
|
||||
This tutorial takes about 10 minutes and covers the essential concepts of building workflows in Sim.
|
||||
This tutorial covers the essential concepts of building workflows in Sim. Estimated completion time: 10 minutes.
|
||||
</Callout>
|
||||
|
||||
## What We're Building
|
||||
## What You'll Build
|
||||
|
||||
A people research agent that:
|
||||
1. Receives a person's name via chat interface
|
||||
2. Uses an AI agent with advanced search capabilities
|
||||
3. Searches the web using state-of-the-art LLM-Search tools (Exa and Linkup)
|
||||
4. Extracts structured information using a response format
|
||||
5. Returns comprehensive data about the person
|
||||
1. Accepts user input through a chat interface
|
||||
2. Searches the web using AI-powered tools (Exa and Linkup)
|
||||
3. Extracts and structures information about individuals
|
||||
4. Returns formatted JSON data with location, profession, and education
|
||||
|
||||
<Image
|
||||
src="/static/getting-started/started-1.png"
|
||||
@@ -49,74 +48,71 @@ A people research agent that:
|
||||
## Step-by-Step Tutorial
|
||||
|
||||
<Steps>
|
||||
<Step title="Create workflow and add AI agent">
|
||||
Open Sim and click "New Workflow" in the dashboard. Name it "Getting Started".
|
||||
<Step title="Create a workflow and add an AI agent">
|
||||
Click **New Workflow** in the dashboard and name it "Getting Started".
|
||||
|
||||
When you create a new workflow, it automatically includes a **Start block** - this is the entry point that receives input from users. For this example, we'll be triggering the workflow via chat, so we don't need to configure anything on the Start block.
|
||||
Every new workflow includes a **Start block** by default—this is the entry point that receives user input. Since we'll trigger this workflow via chat, no configuration is needed for the Start block.
|
||||
|
||||
Now drag an **Agent Block** onto the canvas from the blocks panel on the left.
|
||||
|
||||
Configure the Agent Block:
|
||||
Drag an **Agent Block** onto the canvas from the left panel and configure it:
|
||||
- **Model**: Select "OpenAI GPT-4o"
|
||||
- **System Prompt**: "You are a people research agent. When given a person's name, use your available search tools to find comprehensive information about them including their location, profession, educational background, and other relevant details."
|
||||
- **User Prompt**: Drag the connection from the Start block's output into this field (this connects `<start.input>` to the user prompt)
|
||||
- **User Prompt**: Drag the connection from the Start block's output into this field to connect `<start.input>` to the user prompt
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="getting-started/started-2.mp4" width={700} height={450} />
|
||||
</div>
|
||||
</Step>
|
||||
|
||||
<Step title="Add tools to the agent">
|
||||
Let's enhance our agent with tools for better capabilities. Click on the Agent block to select it.
|
||||
<Step title="Add search tools to the agent">
|
||||
Enhance your agent with web search capabilities. Click on the Agent block to select it.
|
||||
|
||||
In the **Tools** section:
|
||||
- Click **Add Tool**
|
||||
- Select **Exa** from the available tools
|
||||
- Select **Linkup** from the available tools
|
||||
- Add your API keys for both tools (this allows the agent to search the web and access additional information)
|
||||
- Select **Exa** and **Linkup** from the available tools
|
||||
- Provide your API keys for both tools to enable web search and data access
|
||||
|
||||
<div className="mx-auto w-3/5 overflow-hidden rounded-lg">
|
||||
<Video src="getting-started/started-3.mp4" width={700} height={450} />
|
||||
</div>
|
||||
</Step>
|
||||
|
||||
<Step title="Test the basic workflow">
|
||||
Now let's test our workflow. Go to the **Chat panel** on the right side of the screen.
|
||||
<Step title="Test your workflow">
|
||||
Test your workflow using the **Chat panel** on the right side of the screen.
|
||||
|
||||
In the chat panel:
|
||||
- Click the dropdown and select `agent1.content` (this will show us the output of our agent)
|
||||
- Enter a test message like: "John is a software engineer from San Francisco who studied Computer Science at Stanford University."
|
||||
- Click "Send" to run the workflow
|
||||
- Click the dropdown and select `agent1.content` to view the agent's output
|
||||
- Enter a test message: "John is a software engineer from San Francisco who studied Computer Science at Stanford University."
|
||||
- Click **Send** to execute the workflow
|
||||
|
||||
You should see the agent's response analyzing the person described in your text.
|
||||
The agent will analyze the person and return structured information.
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="getting-started/started-4.mp4" width={700} height={450} />
|
||||
</div>
|
||||
</Step>
|
||||
|
||||
<Step title="Add structured output">
|
||||
Now let's make our agent return structured data. Click on the Agent block to select it.
|
||||
<Step title="Configure structured output">
|
||||
Configure your agent to return structured JSON data. Click on the Agent block to select it.
|
||||
|
||||
In the **Response Format** section:
|
||||
- Click the **magic wand icon** (✨) next to the schema field
|
||||
- In the prompt that appears, type: "create a schema named person, that contains location, profession, and education"
|
||||
- The AI will generate a JSON schema for you automatically
|
||||
- Enter the prompt: "create a schema named person, that contains location, profession, and education"
|
||||
- The AI will automatically generate the JSON schema
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="getting-started/started-5.mp4" width={700} height={450} />
|
||||
</div>
|
||||
</Step>
|
||||
|
||||
<Step title="Test the structured output">
|
||||
Go back to the **Chat panel**.
|
||||
<Step title="Test with structured output">
|
||||
Return to the **Chat panel** to test the structured response format.
|
||||
|
||||
Since we added a response format, new output options are now available:
|
||||
- Click the dropdown and select the new structured output option (the schema we just created)
|
||||
- Enter a new test message like: "Sarah is a marketing manager from New York who has an MBA from Harvard Business School."
|
||||
- Click "Send" to run the workflow again
|
||||
With the response format configured, new output options are now available:
|
||||
- Click the dropdown and select the structured output option (the schema you just created)
|
||||
- Enter a test message: "Sarah is a marketing manager from New York who has an MBA from Harvard Business School."
|
||||
- Click **Send** to execute the workflow
|
||||
|
||||
You should now see structured JSON output with the person's information organized into location, profession, and education fields.
|
||||
The agent will now return structured JSON output with the person's information organized into location, profession, and education fields.
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="getting-started/started-6.mp4" width={700} height={450} />
|
||||
@@ -124,15 +120,15 @@ A people research agent that:
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## What You Just Built
|
||||
## What You've Built
|
||||
|
||||
Congratulations! You've created your first AI workflow that:
|
||||
- ✅ Receives text input via chat interface
|
||||
- ✅ Uses AI to extract information from unstructured text
|
||||
- ✅ Integrates external tools (Exa and Linkup) for enhanced capabilities
|
||||
- ✅ Returns structured JSON data using AI-generated schemas
|
||||
- ✅ Demonstrates workflow testing and iteration
|
||||
- ✅ Shows the power of visual workflow building
|
||||
You've successfully created an AI workflow that:
|
||||
- ✅ Accepts user input through a chat interface
|
||||
- ✅ Processes unstructured text using AI
|
||||
- ✅ Integrates external search tools (Exa and Linkup)
|
||||
- ✅ Returns structured JSON data with AI-generated schemas
|
||||
- ✅ Demonstrates real-time testing and iteration
|
||||
- ✅ Showcases the power of visual, no-code development
|
||||
|
||||
## Key Concepts You Learned
|
||||
|
||||
@@ -153,41 +149,48 @@ Congratulations! You've created your first AI workflow that:
|
||||
|
||||
### Core Workflow Concepts
|
||||
|
||||
**Data Flow**: Variables flow between blocks by dragging connections
|
||||
**Data Flow**
|
||||
Connect blocks by dragging connections to pass data between workflow steps
|
||||
|
||||
**Chat Interface**: Test workflows in real-time using the chat panel with different output options
|
||||
**Chat Interface**
|
||||
Test workflows in real-time with the chat panel and select different output options
|
||||
|
||||
**Tool Integration**: Enhance agent capabilities by adding external tools like Exa and Linkup
|
||||
**Tool Integration**
|
||||
Extend agent capabilities by integrating external services like Exa and Linkup
|
||||
|
||||
**Variable References**: Access block outputs using `<blockName.output>` syntax
|
||||
**Variable References**
|
||||
Access block outputs using the `<blockName.output>` syntax
|
||||
|
||||
**Structured Output**: Use JSON schemas to get consistent, structured data from AI
|
||||
**Structured Output**
|
||||
Define JSON schemas to ensure consistent, formatted responses from AI
|
||||
|
||||
**AI-Generated Schemas**: Use the magic wand (✨) to generate schemas with natural language
|
||||
**AI-Generated Schemas**
|
||||
Use the magic wand (✨) to generate schemas from natural language prompts
|
||||
|
||||
**Iterative Development**: Test, modify, and re-test workflows easily
|
||||
**Iterative Development**
|
||||
Build, test, and refine workflows quickly with immediate feedback
|
||||
|
||||
## Next Steps
|
||||
|
||||
<Cards>
|
||||
<Card title="Add More Blocks" href="/blocks">
|
||||
Learn about API, Function, and Condition blocks
|
||||
<Card title="Explore Workflow Blocks" href="/blocks">
|
||||
Discover API, Function, Condition, and other workflow blocks
|
||||
</Card>
|
||||
<Card title="Use Tools" href="/tools">
|
||||
Integrate with external services like Gmail, Slack, and Notion
|
||||
<Card title="Browse Integrations" href="/tools">
|
||||
Connect 80+ services including Gmail, Slack, Notion, and more
|
||||
</Card>
|
||||
<Card title="Add Custom Logic" href="/blocks/function">
|
||||
Use Function blocks for custom data processing
|
||||
Write custom functions for advanced data processing
|
||||
</Card>
|
||||
<Card title="Deploy Your Workflow" href="/execution">
|
||||
Make your workflow accessible via REST API
|
||||
Make your workflow accessible via REST API or webhooks
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
## Need Help?
|
||||
## Resources
|
||||
|
||||
**Stuck on a step?** Check our [Blocks documentation](/blocks) for detailed explanations of each component.
|
||||
**Need detailed explanations?** Visit the [Blocks documentation](/blocks) for comprehensive guides on each component.
|
||||
|
||||
**Want to see more examples?** Browse our [Tools documentation](/tools) to see what integrations are available.
|
||||
**Looking for integrations?** Explore the [Tools documentation](/tools) to see all 80+ available integrations.
|
||||
|
||||
**Ready to deploy?** Learn about [Execution and Deployment](/execution) to make your workflows live.
|
||||
**Ready to go live?** Learn about [Execution and Deployment](/execution) to make your workflows production-ready.
|
||||
|
||||
@@ -48,9 +48,6 @@ Welcome to Sim, a visual workflow builder for AI applications. Build powerful AI
|
||||
<Card title="Team Management" href="/permissions/roles-and-permissions">
|
||||
Set up workspace roles and permissions
|
||||
</Card>
|
||||
<Card title="YAML Configuration" href="/yaml">
|
||||
Define workflows as code
|
||||
</Card>
|
||||
<Card title="MCP Integration" href="/mcp">
|
||||
Connect external services with Model Context Protocol
|
||||
</Card>
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Card, Cards } from 'fumadocs-ui/components/card'
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
Sim is a visual workflow builder for AI applications that lets you build AI agent workflows visually. Create powerful AI agents, automation workflows, and data processing pipelines by connecting blocks on a canvas—no coding required.
|
||||
Sim is an open-source visual workflow builder for building and deploying AI agent workflows. Design intelligent automation systems using a no-code interface—connect AI models, databases, APIs, and business tools through an intuitive drag-and-drop canvas. Whether you're building chatbots, automating business processes, or orchestrating complex data pipelines, Sim provides the tools to bring your AI workflows to life.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
@@ -20,50 +20,52 @@ Sim is a visual workflow builder for AI applications that lets you build AI agen
|
||||
|
||||
## What You Can Build
|
||||
|
||||
**AI Assistants & Chatbots**
|
||||
Create intelligent agents that can search the web, access your calendar, send emails, and interact with your business tools.
|
||||
**AI Assistants & Chatbots**
|
||||
Build intelligent conversational agents that integrate with your tools and data. Enable capabilities like web search, calendar management, email automation, and seamless interaction with business systems.
|
||||
|
||||
**Business Process Automation**
|
||||
Automate repetitive tasks like data entry, report generation, customer support responses, and content creation.
|
||||
**Business Process Automation**
|
||||
Eliminate manual tasks across your organization. Automate data entry, generate reports, respond to customer inquiries, and streamline content creation workflows.
|
||||
|
||||
**Data Processing & Analysis**
|
||||
Extract insights from documents, analyze datasets, generate reports, and sync data between systems.
|
||||
**Data Processing & Analysis**
|
||||
Transform raw data into actionable insights. Extract information from documents, perform dataset analysis, generate automated reports, and synchronize data across platforms.
|
||||
|
||||
**API Integration Workflows**
|
||||
Connect multiple services into unified endpoints, orchestrate complex business logic, and handle event-driven automation.
|
||||
**API Integration Workflows**
|
||||
Orchestrate complex multi-service interactions. Create unified API endpoints, implement sophisticated business logic, and build event-driven automation systems.
|
||||
|
||||
## How It Works
|
||||
|
||||
**Visual Canvas**
|
||||
Drag and drop blocks to build workflows. Connect AI models, databases, APIs, and business tools with simple point-and-click connections.
|
||||
**Visual Workflow Editor**
|
||||
Design workflows using an intuitive drag-and-drop canvas. Connect AI models, databases, APIs, and third-party services through a visual, no-code interface that makes complex automation logic easy to understand and maintain.
|
||||
|
||||
**Smart Blocks**
|
||||
Choose from processing blocks (AI agents, APIs, functions), logic blocks (conditions, loops, routers), and output blocks (responses, evaluators).
|
||||
**Modular Block System**
|
||||
Build with specialized components: processing blocks (AI agents, API calls, custom functions), logic blocks (conditional branching, loops, routers), and output blocks (responses, evaluators). Each block handles a specific task in your workflow.
|
||||
|
||||
**Multiple Triggers**
|
||||
Start workflows via chat interface, REST API, webhooks, scheduled jobs, or external events from services like Slack and GitHub.
|
||||
**Flexible Execution Triggers**
|
||||
Launch workflows through multiple channels including chat interfaces, REST APIs, webhooks, scheduled cron jobs, or external events from platforms like Slack and GitHub.
|
||||
|
||||
**Team Collaboration**
|
||||
Work simultaneously with team members on the same workflow with real-time editing and permissions management.
|
||||
**Real-time Collaboration**
|
||||
Enable your team to build together. Multiple users can edit workflows simultaneously with live updates and granular permission controls.
|
||||
|
||||
## Built-in Integrations
|
||||
## Integrations
|
||||
|
||||
Sim connects to 80+ services out of the box:
|
||||
Sim provides native integrations with 80+ services across multiple categories:
|
||||
|
||||
- **AI Models**: OpenAI, Anthropic, Google, Groq, Cerebras, local Ollama models
|
||||
- **Communication**: Gmail, Slack, Teams, Telegram, WhatsApp
|
||||
- **Productivity**: Notion, Google Sheets, Airtable, Monday.com
|
||||
- **Development**: GitHub, Jira, Linear, browser automation
|
||||
- **Search & Web**: Google Search, Perplexity, Firecrawl, Exa AI
|
||||
- **AI Models**: OpenAI, Anthropic, Google Gemini, Groq, Cerebras, local models via Ollama
|
||||
- **Communication**: Gmail, Slack, Microsoft Teams, Telegram, WhatsApp
|
||||
- **Productivity**: Notion, Google Workspace, Airtable, Monday.com
|
||||
- **Development**: GitHub, Jira, Linear, automated browser testing
|
||||
- **Search & Data**: Google Search, Perplexity, Firecrawl, Exa AI
|
||||
- **Databases**: PostgreSQL, MySQL, Supabase, Pinecone, Qdrant
|
||||
|
||||
Need something custom? Use our [MCP integration](/mcp) to connect any external service.
|
||||
For custom integrations, leverage our [MCP (Model Context Protocol) support](/mcp) to connect any external service or tool.
|
||||
|
||||
## Deployment Options
|
||||
|
||||
**Cloud-hosted**: Get started instantly at [sim.ai](https://sim.ai) with managed infrastructure, automatic scaling, and built-in monitoring.
|
||||
**Cloud-Hosted**
|
||||
Launch immediately at [sim.ai](https://sim.ai) with fully managed infrastructure, automatic scaling, and built-in observability. Focus on building workflows while we handle the operations.
|
||||
|
||||
**Self-hosted**: Deploy on your own infrastructure using Docker, with support for local AI models via Ollama for complete data privacy.
|
||||
**Self-Hosted**
|
||||
Deploy on your own infrastructure using Docker Compose or Kubernetes. Maintain complete control over your data with support for local AI models through Ollama integration.
|
||||
|
||||
## Next Steps
|
||||
|
||||
@@ -77,7 +79,7 @@ Ready to build your first AI workflow?
|
||||
Learn about the building blocks
|
||||
</Card>
|
||||
<Card title="Tools & Integrations" href="/tools">
|
||||
Explore 60+ built-in integrations
|
||||
Explore 80+ built-in integrations
|
||||
</Card>
|
||||
<Card title="Team Permissions" href="/permissions/roles-and-permissions">
|
||||
Set up workspace roles and permissions
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: MCP (Model Context Protocol)
|
||||
---
|
||||
|
||||
import { Video } from '@/components/ui/video'
|
||||
import { Image } from '@/components/ui/image'
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
|
||||
The Model Context Protocol ([MCP](https://modelcontextprotocol.com/)) allows you to connect external tools and services using a standardized protocol, enabling you to integrate APIs and services directly into your workflows. With MCP, you can extend Sim's capabilities by adding custom integrations that work seamlessly with your agents and workflows.
|
||||
@@ -16,16 +16,18 @@ MCP is an open standard that enables AI assistants to securely connect to extern
|
||||
- Execute custom tools and scripts
|
||||
- Maintain secure, controlled access to external resources
|
||||
|
||||
## Adding MCP Servers
|
||||
## Configuring MCP Servers
|
||||
|
||||
MCP servers provide collections of tools that your agents can use. You can add MCP servers in two ways:
|
||||
MCP servers provide collections of tools that your agents can use. Configure them in workspace settings:
|
||||
|
||||
### From Workspace Settings
|
||||
|
||||
Configure MCP servers at the workspace level so all team members can use them:
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="mcp-1.mp4" width={700} height={450} />
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/mcp-1.png"
|
||||
alt="Configuring MCP Server in Settings"
|
||||
width={700}
|
||||
height={450}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
1. Navigate to your workspace settings
|
||||
@@ -35,25 +37,21 @@ Configure MCP servers at the workspace level so all team members can use them:
|
||||
5. Save the configuration
|
||||
|
||||
<Callout type="info">
|
||||
MCP servers configured in workspace settings are available to all workspace members based on their permission levels.
|
||||
You can also configure MCP servers directly from the toolbar in an Agent block for quick setup.
|
||||
</Callout>
|
||||
|
||||
### From Agent Configuration
|
||||
|
||||
You can also add and configure MCP servers directly from within an agent block:
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="mcp-2.mp4" width={700} height={450} />
|
||||
</div>
|
||||
|
||||
This is useful when you need to quickly set up a specific integration for a particular workflow.
|
||||
|
||||
## Using MCP Tools in Agents
|
||||
|
||||
Once MCP servers are configured, their tools become available within your agent blocks:
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="mcp-3.mp4" width={700} height={450} />
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/mcp-2.png"
|
||||
alt="Using MCP Tool in Agent Block"
|
||||
width={700}
|
||||
height={450}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
1. Open an **Agent** block
|
||||
@@ -65,8 +63,14 @@ Once MCP servers are configured, their tools become available within your agent
|
||||
|
||||
For more granular control, you can use the dedicated MCP Tool block to execute specific MCP tools:
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="mcp-4.mp4" width={700} height={450} />
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/mcp-3.png"
|
||||
alt="Standalone MCP Tool Block"
|
||||
width={700}
|
||||
height={450}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
The MCP Tool block allows you to:
|
||||
|
||||
@@ -4,6 +4,7 @@ description: Receive webhooks from any service by configuring a custom webhook.
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
<BlockInfoCard
|
||||
type="generic_webhook"
|
||||
@@ -22,9 +23,15 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
|
||||
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/webhook.png"
|
||||
alt="Webhook Block Configuration"
|
||||
width={500}
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Overview
|
||||
|
||||
|
||||
@@ -5,10 +5,14 @@ description: Powerful tools to enhance your agentic workflows
|
||||
|
||||
import { Card, Cards } from "fumadocs-ui/components/card";
|
||||
import { Step, Steps } from "fumadocs-ui/components/steps";
|
||||
import { Tab, Tabs } from "fumadocs-ui/components/tabs";
|
||||
import { Video } from '@/components/ui/video';
|
||||
|
||||
Tools are powerful components in Sim that allow your workflows to interact with external services, process data, and perform specialized tasks. They extend the capabilities of your agents and workflows by providing access to various APIs and services.
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="toolbar.mp4" width={700} height={450} />
|
||||
</div>
|
||||
|
||||
## What is a Tool?
|
||||
|
||||
A tool is a specialized component that provides a specific functionality or integration with external services. Tools can be used to search the web, interact with databases, process images, generate text or images, communicate via messaging platforms, and much more.
|
||||
@@ -64,14 +68,3 @@ Tools typically return structured data that can be processed by subsequent block
|
||||
- Status information
|
||||
|
||||
Refer to each tool's specific documentation to understand its exact output format.
|
||||
|
||||
## YAML Configuration
|
||||
|
||||
For detailed YAML workflow configuration and syntax, see the [YAML Workflow Reference](/yaml) documentation. This includes comprehensive guides for:
|
||||
|
||||
- **Block Reference Syntax**: How to connect and reference data between blocks
|
||||
- **Tool Configuration**: Using tools in both standalone blocks and agent configurations
|
||||
- **Environment Variables**: Secure handling of API keys and credentials
|
||||
- **Complete Examples**: Real-world workflow patterns and configurations
|
||||
|
||||
For specific tool parameters and configuration options, refer to each tool's individual documentation page.
|
||||
|
||||
@@ -11,7 +11,7 @@ The Schedule block automatically triggers workflows on a recurring schedule at s
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/schedule.png"
|
||||
src="/static/blocks/schedule.png"
|
||||
alt="Schedule Block"
|
||||
width={500}
|
||||
height={400}
|
||||
@@ -45,20 +45,26 @@ Configure when your workflow runs using the dropdown options:
|
||||
|
||||
## Configuring Schedules
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="configure-schedule.mp4" width={700} height={450} />
|
||||
</div>
|
||||
|
||||
When a workflow is scheduled:
|
||||
- The schedule becomes **active** and shows the next execution time
|
||||
- Click the **"Scheduled"** button to deactivate the schedule
|
||||
- Schedules automatically deactivate after **3 consecutive failures**
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/schedule-2.png"
|
||||
alt="Active Schedule Block"
|
||||
width={500}
|
||||
height={350}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Disabled Schedules
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/schedule-disabled.png"
|
||||
src="/static/blocks/schedule-3.png"
|
||||
alt="Disabled Schedule"
|
||||
width={500}
|
||||
height={350}
|
||||
@@ -66,7 +72,7 @@ When a workflow is scheduled:
|
||||
/>
|
||||
</div>
|
||||
|
||||
Disabled schedules show when they were last active and can be re-enabled at any time.
|
||||
Disabled schedules show when they were last active. Click the **"Disabled"** badge to reactivate the schedule.
|
||||
|
||||
<Callout>
|
||||
Schedule blocks cannot receive incoming connections and serve as pure workflow triggers.
|
||||
|
||||
@@ -4,16 +4,23 @@ title: Webhooks
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
Webhooks allow external services to trigger workflow execution from external webhooks by sending HTTP requests to your workflow. Sim supports two approaches for webhook-based triggers.
|
||||
Webhooks allow external services to trigger workflow execution by sending HTTP requests to your workflow. Sim supports two approaches for webhook-based triggers.
|
||||
|
||||
## Generic Webhook Trigger
|
||||
|
||||
The Generic Webhook block creates a flexible endpoint that can receive any payload and trigger your workflow:
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="webhooks-1.mp4" width={700} height={450} />
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/webhook.png"
|
||||
alt="Generic Webhook Configuration"
|
||||
width={700}
|
||||
height={450}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
### How It Works
|
||||
|
||||
@@ -19,34 +19,6 @@ El bloque API te permite conectar tu flujo de trabajo a servicios externos a tra
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Descripción general
|
||||
|
||||
El bloque API te permite:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Conectar con servicios externos</strong>: Realizar peticiones HTTP a APIs REST y servicios web
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Enviar y recibir datos</strong>: Procesar respuestas y transformar datos de fuentes externas
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Integrar plataformas de terceros</strong>: Conectar con servicios como Stripe, Slack o APIs personalizadas
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Gestionar la autenticación</strong>: Admitir varios métodos de autenticación, incluyendo tokens Bearer y claves API
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Cómo funciona
|
||||
|
||||
El bloque API procesa las peticiones HTTP a través de un enfoque estructurado:
|
||||
|
||||
1. **Configurar petición** - Establecer URL, método, cabeceras y parámetros del cuerpo
|
||||
2. **Ejecutar petición** - Enviar petición HTTP al endpoint especificado
|
||||
3. **Procesar respuesta** - Gestionar datos de respuesta, códigos de estado y cabeceras
|
||||
4. **Gestión de errores** - Administrar tiempos de espera, reintentos y condiciones de error
|
||||
|
||||
## Opciones de configuración
|
||||
|
||||
### URL
|
||||
|
||||
@@ -20,39 +20,6 @@ El bloque de Condición te permite ramificar la ruta de ejecución de tu flujo d
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Callout>
|
||||
Los bloques de Condición permiten una toma de decisiones determinista sin requerir un LLM, haciéndolos ideales
|
||||
para lógica de ramificación sencilla.
|
||||
</Callout>
|
||||
|
||||
## Descripción general
|
||||
|
||||
El bloque de Condición te permite:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Crear lógica de ramificación</strong>: dirigir flujos de trabajo basados en expresiones booleanas
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Tomar decisiones basadas en datos</strong>: evaluar condiciones usando salidas de bloques anteriores
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Manejar múltiples escenarios</strong>: definir múltiples condiciones con diferentes rutas
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Proporcionar enrutamiento determinista</strong>: tomar decisiones sin requerir un LLM
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Cómo funciona
|
||||
|
||||
El bloque de Condición opera a través de un proceso de evaluación secuencial:
|
||||
|
||||
1. **Evaluar expresión** - Procesa la expresión booleana de JavaScript/TypeScript usando los datos actuales del flujo de trabajo
|
||||
2. **Determinar resultado** - Devuelve verdadero o falso basado en la evaluación de la expresión
|
||||
3. **Dirigir flujo de trabajo** - Dirige la ejecución al bloque de destino apropiado basado en el resultado
|
||||
4. **Proporcionar contexto** - Genera metadatos sobre la decisión para depuración y monitoreo
|
||||
|
||||
## Opciones de configuración
|
||||
|
||||
### Condiciones
|
||||
|
||||
@@ -23,54 +23,6 @@ El bloque de Respuesta es el paso final en tu flujo de trabajo que formatea y en
|
||||
Los bloques de respuesta son bloques terminales - finalizan la ejecución del flujo de trabajo y no pueden conectarse a otros bloques.
|
||||
</Callout>
|
||||
|
||||
## Descripción general
|
||||
|
||||
El bloque de Respuesta te permite:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Formatear respuestas API</strong>: Estructurar los resultados del flujo de trabajo en respuestas HTTP adecuadas
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Establecer códigos de estado</strong>: Configurar códigos de estado HTTP apropiados según los resultados del flujo de trabajo
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Controlar encabezados</strong>: Añadir encabezados personalizados para respuestas API y webhooks
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Transformar datos</strong>: Convertir variables del flujo de trabajo en formatos de respuesta amigables para el cliente
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Cómo funciona
|
||||
|
||||
El bloque de Respuesta finaliza la ejecución del flujo de trabajo:
|
||||
|
||||
1. **Recopilar datos** - Reúne variables y salidas de bloques anteriores
|
||||
2. **Formatear respuesta** - Estructura los datos según tu configuración
|
||||
3. **Establecer detalles HTTP** - Aplica códigos de estado y encabezados
|
||||
4. **Enviar respuesta** - Devuelve la respuesta formateada al solicitante de la API
|
||||
|
||||
## Cuándo necesitas bloques de respuesta
|
||||
|
||||
- **Endpoints API**: Cuando tu flujo de trabajo es llamado vía API, los bloques de Respuesta formatean los datos de retorno
|
||||
- **Webhooks**: Devuelven confirmación o datos al sistema que realiza la llamada
|
||||
- **Pruebas**: Ver resultados formateados al probar tu flujo de trabajo
|
||||
|
||||
## Dos formas de construir respuestas
|
||||
|
||||
### Modo constructor (recomendado)
|
||||
Interfaz visual para construir la estructura de respuesta:
|
||||
- Arrastrar y soltar campos
|
||||
- Referenciar variables de flujo de trabajo fácilmente
|
||||
- Vista previa visual de la estructura de respuesta
|
||||
|
||||
### Modo editor (avanzado)
|
||||
Escribir JSON directamente:
|
||||
- Control total sobre el formato de respuesta
|
||||
- Soporte para estructuras anidadas complejas
|
||||
- Usar sintaxis `<variable.name>` para valores dinámicos
|
||||
|
||||
## Opciones de configuración
|
||||
|
||||
### Datos de respuesta
|
||||
|
||||
@@ -21,60 +21,17 @@ El bloque Router utiliza IA para decidir de manera inteligente qué camino debe
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Descripción general
|
||||
## Router vs Condición
|
||||
|
||||
El bloque Router te permite:
|
||||
**Usar Router cuando:**
|
||||
- Se necesita análisis de contenido impulsado por IA
|
||||
- Se trabaja con contenido no estructurado o variable
|
||||
- Se requiere enrutamiento basado en intención (p. ej., "dirigir tickets a departamentos")
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Enrutamiento inteligente de contenido</strong>: Usa IA para entender la intención y el contexto
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Selección dinámica de rutas</strong>: Dirige flujos de trabajo basados en análisis de contenido no estructurado
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Decisiones conscientes del contexto</strong>: Toma decisiones inteligentes de enrutamiento más allá de reglas simples
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Gestión de múltiples rutas</strong>: Maneja flujos de trabajo complejos con múltiples destinos potenciales
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Router vs bloques de Condición
|
||||
|
||||
<Accordions>
|
||||
<Accordion title="Cuándo usar Router">
|
||||
- Se necesita análisis de contenido impulsado por IA
|
||||
- Contenido no estructurado o tipos de contenido variables
|
||||
- Enrutamiento basado en intención (p. ej., "dirigir tickets de soporte a departamentos")
|
||||
- Se requiere toma de decisiones consciente del contexto
|
||||
</Accordion>
|
||||
<Accordion title="Cuándo usar Condición">
|
||||
- Decisiones simples basadas en reglas
|
||||
- Datos estructurados o comparaciones numéricas
|
||||
- Se necesita enrutamiento rápido y determinista
|
||||
- Lógica booleana suficiente
|
||||
</Accordion>
|
||||
</Accordions>
|
||||
|
||||
## Cómo funciona
|
||||
|
||||
El bloque Router:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Analiza el contenido</strong>: Utiliza un LLM para entender el contenido y el contexto de entrada
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Evalúa objetivos</strong>: Compara el contenido con los bloques de destino disponibles
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Selecciona el destino</strong>: Identifica la ruta más apropiada basada en la intención
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Ejecuta el enrutamiento</strong>: Dirige el flujo de trabajo al bloque seleccionado
|
||||
</Step>
|
||||
</Steps>
|
||||
**Usar Condición cuando:**
|
||||
- Decisiones simples basadas en reglas son suficientes
|
||||
- Se trabaja con datos estructurados o comparaciones numéricas
|
||||
- Se necesita enrutamiento rápido y determinista
|
||||
|
||||
## Opciones de configuración
|
||||
|
||||
@@ -105,7 +62,7 @@ Elige un modelo de IA para potenciar la decisión de enrutamiento:
|
||||
**Modelos locales**: Cualquier modelo ejecutándose en Ollama
|
||||
|
||||
<div className="w-full max-w-2xl mx-auto overflow-hidden rounded-lg">
|
||||
<Video src="router-model-dropdown.mp4" width={500} height={350} />
|
||||
<Video src="models.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
**Recomendación**: Utiliza modelos con fuertes capacidades de razonamiento como GPT-4o o Claude 3.7 Sonnet para decisiones de enrutamiento más precisas.
|
||||
@@ -124,58 +81,6 @@ Después de que un router tome una decisión, puedes acceder a sus resultados:
|
||||
- **`<router.cost>`**: Resumen de costos para la llamada de enrutamiento (entrada, salida, total)
|
||||
- **`<router.model>`**: El modelo utilizado para la toma de decisiones
|
||||
|
||||
## Funciones avanzadas
|
||||
|
||||
### Criterios de enrutamiento personalizados
|
||||
|
||||
Define criterios específicos para cada bloque de destino:
|
||||
|
||||
```javascript
|
||||
// Example routing descriptions
|
||||
Target Block 1: "Technical support issues, API problems, integration questions"
|
||||
Target Block 2: "Billing inquiries, subscription changes, payment issues"
|
||||
Target Block 3: "General questions, feedback, feature requests"
|
||||
```
|
||||
|
||||
## Entradas y salidas
|
||||
|
||||
<Tabs items={['Configuración', 'Variables']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Contenido/Prompt</strong>: Texto a analizar para decisiones de enrutamiento
|
||||
</li>
|
||||
<li>
|
||||
<strong>Bloques de destino</strong>: Bloques conectados como destinos potenciales
|
||||
</li>
|
||||
<li>
|
||||
<strong>Modelo</strong>: Modelo de IA para análisis de enrutamiento
|
||||
</li>
|
||||
<li>
|
||||
<strong>Clave API</strong>: Autenticación para el proveedor LLM seleccionado
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>router.prompt</strong>: Resumen del prompt de enrutamiento utilizado
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.selected_path</strong>: Detalles del destino elegido
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.tokens</strong>: Estadísticas de uso de tokens
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.cost</strong>: Resumen de costos para la llamada de enrutamiento (entrada, salida, total)
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.model</strong>: Modelo utilizado para la toma de decisiones
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Ejemplos de casos de uso
|
||||
|
||||
|
||||
@@ -18,22 +18,6 @@ El bloque Espera pausa tu flujo de trabajo durante un tiempo específico antes d
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Descripción general
|
||||
|
||||
El bloque Espera te permite:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Añadir retrasos de tiempo</strong>: Pausar la ejecución entre pasos del flujo de trabajo
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Respetar límites de frecuencia</strong>: Espaciar llamadas a API para mantenerse dentro de los límites
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Programar secuencias</strong>: Crear flujos de trabajo temporizados con retrasos entre acciones
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Configuración
|
||||
|
||||
### Cantidad de espera
|
||||
|
||||
@@ -77,29 +77,6 @@ Sim proporciona diferentes tipos de bloques que sirven para propósitos específ
|
||||
|
||||
Todos los bloques se ejecutan automáticamente basándose en sus dependencias - no necesitas gestionar manualmente el orden de ejecución o el tiempo.
|
||||
|
||||
## Disparadores de ejecución
|
||||
|
||||
Los flujos de trabajo pueden activarse de varias maneras, dependiendo de tu caso de uso:
|
||||
|
||||
### Pruebas manuales
|
||||
Haz clic en "Ejecutar" en el editor de flujo de trabajo para probar tu flujo de trabajo durante el desarrollo. Perfecto para depuración y validación.
|
||||
|
||||
### Ejecución programada
|
||||
Configura ejecuciones recurrentes usando expresiones cron. Ideal para procesamiento regular de datos, informes o tareas de mantenimiento.
|
||||
|
||||
### Despliegue de API
|
||||
Despliega flujos de trabajo como endpoints HTTP que pueden ser llamados programáticamente desde tus aplicaciones.
|
||||
|
||||
### Integración de Webhook
|
||||
Responde a eventos de servicios externos como GitHub, Stripe o sistemas personalizados en tiempo real.
|
||||
|
||||
### Interfaz de chat
|
||||
Crea interfaces conversacionales alojadas en subdominios personalizados para aplicaciones de IA orientadas al usuario.
|
||||
|
||||
<Callout type="info">
|
||||
Aprende más sobre cada tipo de disparador en la [sección de Disparadores](/triggers) de la documentación.
|
||||
</Callout>
|
||||
|
||||
## Monitoreo de ejecución
|
||||
|
||||
Cuando los flujos de trabajo se ejecutan, Sim proporciona visibilidad en tiempo real del proceso de ejecución:
|
||||
|
||||
@@ -96,7 +96,7 @@ Todos los puntos de entrada públicos—API, Chat, Programación, Webhook y ejec
|
||||
|
||||
<div className='flex justify-center my-6'>
|
||||
<Image
|
||||
src='/static/execution/deployment-versions-light.png'
|
||||
src='/static/execution/deployment-versions.png'
|
||||
alt='Tabla de versiones de despliegue'
|
||||
width={500}
|
||||
height={280}
|
||||
|
||||
@@ -4,6 +4,7 @@ description: Recibe webhooks de cualquier servicio configurando un webhook perso
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
<BlockInfoCard
|
||||
type="generic_webhook"
|
||||
@@ -22,6 +23,16 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/webhook.png"
|
||||
alt="Webhook Block Configuration"
|
||||
width={500}
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Descripción general
|
||||
|
||||
El bloque de Webhook Genérico te permite recibir webhooks desde cualquier servicio externo. Este es un disparador flexible que puede manejar cualquier carga útil JSON, lo que lo hace ideal para integrarse con servicios que no tienen un bloque Sim dedicado.
|
||||
|
||||
@@ -11,7 +11,7 @@ El bloque de Programación activa automáticamente flujos de trabajo de forma re
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/schedule.png"
|
||||
src="/static/blocks/schedule.png"
|
||||
alt="Bloque de programación"
|
||||
width={500}
|
||||
height={400}
|
||||
@@ -45,10 +45,6 @@ Configura cuándo se ejecuta tu flujo de trabajo utilizando las opciones despleg
|
||||
|
||||
## Configuración de programaciones
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="configure-schedule.mp4" width={700} height={450} />
|
||||
</div>
|
||||
|
||||
Cuando un flujo de trabajo está programado:
|
||||
- La programación se vuelve **activa** y muestra el próximo tiempo de ejecución
|
||||
- Haz clic en el botón **"Programado"** para desactivar la programación
|
||||
@@ -58,7 +54,7 @@ Cuando un flujo de trabajo está programado:
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/schedule-disabled.png"
|
||||
src="/static/blocks/schedule-3.png"
|
||||
alt="Programación desactivada"
|
||||
width={500}
|
||||
height={350}
|
||||
|
||||
@@ -4,6 +4,7 @@ title: Webhooks
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
Los webhooks permiten que servicios externos activen la ejecución de flujos de trabajo desde webhooks externos mediante el envío de solicitudes HTTP a tu flujo de trabajo. Sim admite dos enfoques para los disparadores basados en webhooks.
|
||||
@@ -12,8 +13,14 @@ Los webhooks permiten que servicios externos activen la ejecución de flujos de
|
||||
|
||||
El bloque de webhook genérico crea un punto de conexión flexible que puede recibir cualquier carga útil y activar tu flujo de trabajo:
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="webhooks-1.mp4" width={700} height={450} />
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/webhook.png"
|
||||
alt="Generic Webhook Configuration"
|
||||
width={700}
|
||||
height={450}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
### Cómo funciona
|
||||
|
||||
@@ -19,34 +19,6 @@ Le bloc API vous permet de connecter votre flux de travail à des services exter
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Aperçu
|
||||
|
||||
Le bloc API vous permet de :
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Connecter à des services externes</strong> : effectuer des requêtes HTTP vers des API REST et des services web
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Envoyer et recevoir des données</strong> : traiter les réponses et transformer les données provenant de sources externes
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Intégrer des plateformes tierces</strong> : se connecter à des services comme Stripe, Slack ou des API personnalisées
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Gérer l'authentification</strong> : prendre en charge diverses méthodes d'authentification, y compris les jetons Bearer et les clés API
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Comment ça fonctionne
|
||||
|
||||
Le bloc API traite les requêtes HTTP selon une approche structurée :
|
||||
|
||||
1. **Configuration de la requête** - Définir l'URL, la méthode, les en-têtes et les paramètres du corps
|
||||
2. **Exécution de la requête** - Envoyer la requête HTTP au point de terminaison spécifié
|
||||
3. **Traitement de la réponse** - Gérer les données de réponse, les codes d'état et les en-têtes
|
||||
4. **Gestion des erreurs** - Gérer les délais d'attente, les nouvelles tentatives et les conditions d'erreur
|
||||
|
||||
## Options de configuration
|
||||
|
||||
### URL
|
||||
|
||||
@@ -20,39 +20,6 @@ Le bloc Condition vous permet de ramifier le chemin d'exécution de votre flux d
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Callout>
|
||||
Les blocs Condition permettent une prise de décision déterministe sans nécessiter un LLM, ce qui les rend idéaux
|
||||
pour une logique de branchement simple.
|
||||
</Callout>
|
||||
|
||||
## Aperçu
|
||||
|
||||
Le bloc Condition vous permet de :
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Créer une logique de branchement</strong> : acheminer les flux de travail en fonction d'expressions booléennes
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Prendre des décisions basées sur les données</strong> : évaluer les conditions en utilisant les sorties des blocs précédents
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Gérer plusieurs scénarios</strong> : définir plusieurs conditions avec différents chemins
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Fournir un routage déterministe</strong> : prendre des décisions sans nécessiter un LLM
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Comment ça fonctionne
|
||||
|
||||
Le bloc Condition fonctionne par un processus d'évaluation séquentiel :
|
||||
|
||||
1. **Évaluation de l'expression** - Traite l'expression booléenne JavaScript/TypeScript en utilisant les données actuelles du flux de travail
|
||||
2. **Détermination du résultat** - Renvoie vrai ou faux en fonction de l'évaluation de l'expression
|
||||
3. **Acheminement du flux de travail** - Dirige l'exécution vers le bloc de destination approprié en fonction du résultat
|
||||
4. **Fourniture de contexte** - Génère des métadonnées sur la décision pour le débogage et la surveillance
|
||||
|
||||
## Options de configuration
|
||||
|
||||
### Conditions
|
||||
|
||||
@@ -23,54 +23,6 @@ Le bloc Réponse est la dernière étape de votre workflow qui formate et envoie
|
||||
Les blocs Réponse sont des blocs terminaux - ils mettent fin à l'exécution du workflow et ne peuvent pas se connecter à d'autres blocs.
|
||||
</Callout>
|
||||
|
||||
## Aperçu
|
||||
|
||||
Le bloc Réponse vous permet de :
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Formater les réponses API</strong> : structurer les résultats du workflow en réponses HTTP appropriées
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Définir les codes d'état</strong> : configurer les codes d'état HTTP appropriés en fonction des résultats du workflow
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Contrôler les en-têtes</strong> : ajouter des en-têtes personnalisés pour les réponses API et les webhooks
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Transformer les données</strong> : convertir les variables du workflow en formats de réponse adaptés aux clients
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Comment ça fonctionne
|
||||
|
||||
Le bloc Réponse finalise l'exécution du workflow :
|
||||
|
||||
1. **Collecte des données** - Rassemble les variables et les sorties des blocs précédents
|
||||
2. **Formatage de la réponse** - Structure les données selon votre configuration
|
||||
3. **Définition des détails HTTP** - Applique les codes d'état et les en-têtes
|
||||
4. **Envoi de la réponse** - Renvoie la réponse formatée à l'appelant de l'API
|
||||
|
||||
## Quand utiliser les blocs Réponse
|
||||
|
||||
- **Points de terminaison API** : lorsque votre workflow est appelé via API, les blocs Réponse formatent les données de retour
|
||||
- **Webhooks** : renvoie une confirmation ou des données au système appelant
|
||||
- **Tests** : visualisez les résultats formatés lors du test de votre workflow
|
||||
|
||||
## Deux façons de construire des réponses
|
||||
|
||||
### Mode constructeur (recommandé)
|
||||
Interface visuelle pour construire la structure de réponse :
|
||||
- Glisser-déposer des champs
|
||||
- Référencer facilement les variables de flux
|
||||
- Aperçu visuel de la structure de réponse
|
||||
|
||||
### Mode éditeur (avancé)
|
||||
Écrire du JSON directement :
|
||||
- Contrôle total sur le format de réponse
|
||||
- Prise en charge des structures imbriquées complexes
|
||||
- Utiliser la syntaxe `<variable.name>` pour les valeurs dynamiques
|
||||
|
||||
## Options de configuration
|
||||
|
||||
### Données de réponse
|
||||
|
||||
@@ -21,60 +21,17 @@ Le bloc Routeur utilise l'IA pour décider intelligemment quel chemin votre flux
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Aperçu
|
||||
## Routeur vs Condition
|
||||
|
||||
Le bloc Routeur vous permet de :
|
||||
**Utiliser le Routeur quand :**
|
||||
- Analyse de contenu par IA nécessaire
|
||||
- Travail avec contenu non structuré ou variable
|
||||
- Routage basé sur l'intention requis (ex. : « acheminer les tickets vers les départements »)
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Routage intelligent du contenu</strong> : utiliser l'IA pour comprendre l'intention et le contexte
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Sélection dynamique de chemin</strong> : acheminer les flux de travail basés sur l'analyse de contenu non structuré
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Décisions contextuelles</strong> : prendre des choix d'acheminement intelligents au-delà des règles simples
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Gestion multi-chemins</strong> : gérer des flux de travail complexes avec plusieurs destinations potentielles
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Routeur vs blocs Condition
|
||||
|
||||
<Accordions>
|
||||
<Accordion title="Quand utiliser le Routeur">
|
||||
- Analyse de contenu par IA nécessaire
|
||||
- Types de contenu non structurés ou variables
|
||||
- Routage basé sur l'intention (ex. : « acheminer les tickets de support vers les départements »)
|
||||
- Prise de décision contextuelle requise
|
||||
</Accordion>
|
||||
<Accordion title="Quand utiliser la Condition">
|
||||
- Décisions simples basées sur des règles
|
||||
- Données structurées ou comparaisons numériques
|
||||
- Routage rapide et déterministe nécessaire
|
||||
- Logique booléenne suffisante
|
||||
</Accordion>
|
||||
</Accordions>
|
||||
|
||||
## Comment ça fonctionne
|
||||
|
||||
Le bloc Routeur :
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Analyse le contenu</strong> : utilise un LLM pour comprendre le contenu et le contexte d'entrée
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Évalue les cibles</strong> : compare le contenu aux blocs de destination disponibles
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Sélectionne la destination</strong> : identifie le chemin le plus approprié selon l'intention
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Achemine l'exécution</strong> : dirige le flux de travail vers le bloc sélectionné
|
||||
</Step>
|
||||
</Steps>
|
||||
**Utiliser la Condition quand :**
|
||||
- Décisions simples basées sur des règles suffisent
|
||||
- Travail avec données structurées ou comparaisons numériques
|
||||
- Routage rapide et déterministe nécessaire
|
||||
|
||||
## Options de configuration
|
||||
|
||||
@@ -105,7 +62,7 @@ Choisissez un modèle d'IA pour alimenter la décision d'acheminement :
|
||||
**Modèles locaux** : Tout modèle fonctionnant sur Ollama
|
||||
|
||||
<div className="w-full max-w-2xl mx-auto overflow-hidden rounded-lg">
|
||||
<Video src="router-model-dropdown.mp4" width={500} height={350} />
|
||||
<Video src="models.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
**Recommandation** : utilisez des modèles avec de fortes capacités de raisonnement comme GPT-4o ou Claude 3.7 Sonnet pour des décisions d'acheminement plus précises.
|
||||
@@ -124,58 +81,6 @@ Après qu'un routeur prend une décision, vous pouvez accéder à ses sorties :
|
||||
- **`<router.cost>`** : résumé des coûts pour l'appel d'acheminement (entrée, sortie, total)
|
||||
- **`<router.model>`** : le modèle utilisé pour la prise de décision
|
||||
|
||||
## Fonctionnalités avancées
|
||||
|
||||
### Critères d'acheminement personnalisés
|
||||
|
||||
Définissez des critères spécifiques pour chaque bloc cible :
|
||||
|
||||
```javascript
|
||||
// Example routing descriptions
|
||||
Target Block 1: "Technical support issues, API problems, integration questions"
|
||||
Target Block 2: "Billing inquiries, subscription changes, payment issues"
|
||||
Target Block 3: "General questions, feedback, feature requests"
|
||||
```
|
||||
|
||||
## Entrées et sorties
|
||||
|
||||
<Tabs items={['Configuration', 'Variables']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>Contenu/Prompt</strong> : texte à analyser pour les décisions de routage
|
||||
</li>
|
||||
<li>
|
||||
<strong>Blocs cibles</strong> : blocs connectés comme destinations potentielles
|
||||
</li>
|
||||
<li>
|
||||
<strong>Modèle</strong> : modèle d'IA pour l'analyse de routage
|
||||
</li>
|
||||
<li>
|
||||
<strong>Clé API</strong> : authentification pour le fournisseur LLM sélectionné
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>router.prompt</strong> : résumé du prompt de routage utilisé
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.selected_path</strong> : détails de la destination choisie
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.tokens</strong> : statistiques d'utilisation des tokens
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.cost</strong> : résumé des coûts pour l'appel de routage (entrée, sortie, total)
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.model</strong> : modèle utilisé pour la prise de décision
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Exemples de cas d'utilisation
|
||||
|
||||
|
||||
@@ -18,22 +18,6 @@ Le bloc Attente met en pause votre flux de travail pendant une durée spécifié
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Aperçu
|
||||
|
||||
Le bloc Attente vous permet de :
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>Ajouter des délais</strong> : mettre en pause l'exécution entre les étapes du flux de travail
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Respecter les limites de taux</strong> : espacer les appels API pour rester dans les limites
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>Planifier des séquences</strong> : créer des flux de travail chronométrés avec des délais entre les actions
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Configuration
|
||||
|
||||
### Durée d'attente
|
||||
|
||||
@@ -77,29 +77,6 @@ Sim fournit différents types de blocs qui servent à des fins spécifiques dans
|
||||
|
||||
Tous les blocs s'exécutent automatiquement en fonction de leurs dépendances - vous n'avez pas besoin de gérer manuellement l'ordre ou le timing d'exécution.
|
||||
|
||||
## Déclencheurs d'exécution
|
||||
|
||||
Les flux de travail peuvent être déclenchés de plusieurs façons, selon votre cas d'utilisation :
|
||||
|
||||
### Test manuel
|
||||
Cliquez sur "Exécuter" dans l'éditeur de flux de travail pour tester votre flux pendant le développement. Parfait pour le débogage et la validation.
|
||||
|
||||
### Exécution programmée
|
||||
Configurez des exécutions récurrentes à l'aide d'expressions cron. Idéal pour le traitement régulier des données, les rapports ou les tâches de maintenance.
|
||||
|
||||
### Déploiement d'API
|
||||
Déployez des flux de travail comme points de terminaison HTTP qui peuvent être appelés par programmation depuis vos applications.
|
||||
|
||||
### Intégration Webhook
|
||||
Répondez en temps réel aux événements provenant de services externes comme GitHub, Stripe ou des systèmes personnalisés.
|
||||
|
||||
### Interface de chat
|
||||
Créez des interfaces conversationnelles hébergées sur des sous-domaines personnalisés pour des applications d'IA destinées aux utilisateurs.
|
||||
|
||||
<Callout type="info">
|
||||
Apprenez-en plus sur chaque type de déclencheur dans la [section Déclencheurs](/triggers) de la documentation.
|
||||
</Callout>
|
||||
|
||||
## Surveillance de l'exécution
|
||||
|
||||
Lorsque les workflows s'exécutent, Sim offre une visibilité en temps réel sur le processus d'exécution :
|
||||
|
||||
@@ -96,7 +96,7 @@ Tous les points d'entrée publics — API, Chat, Planification, Webhook et exéc
|
||||
|
||||
<div className='flex justify-center my-6'>
|
||||
<Image
|
||||
src='/static/execution/deployment-versions-light.png'
|
||||
src='/static/execution/deployment-versions.png'
|
||||
alt='Tableau des versions de déploiement'
|
||||
width={500}
|
||||
height={280}
|
||||
|
||||
@@ -5,6 +5,7 @@ description: Recevez des webhooks de n'importe quel service en configurant un
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
<BlockInfoCard
|
||||
type="generic_webhook"
|
||||
@@ -23,6 +24,16 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/webhook.png"
|
||||
alt="Webhook Block Configuration"
|
||||
width={500}
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
## Aperçu
|
||||
|
||||
Le bloc Webhook générique vous permet de recevoir des webhooks depuis n'importe quel service externe. C'est un déclencheur flexible qui peut traiter n'importe quelle charge utile JSON, ce qui le rend idéal pour l'intégration avec des services qui n'ont pas de bloc Sim dédié.
|
||||
|
||||
@@ -11,7 +11,7 @@ Le bloc Planification déclenche automatiquement des workflows de manière récu
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/schedule.png"
|
||||
src="/static/blocks/schedule.png"
|
||||
alt="Bloc de planification"
|
||||
width={500}
|
||||
height={400}
|
||||
@@ -45,10 +45,6 @@ Configurez quand votre workflow s'exécute en utilisant les options du menu dér
|
||||
|
||||
## Configuration des planifications
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="configure-schedule.mp4" width={700} height={450} />
|
||||
</div>
|
||||
|
||||
Lorsqu'un workflow est planifié :
|
||||
- La planification devient **active** et affiche la prochaine heure d'exécution
|
||||
- Cliquez sur le bouton **"Planifié"** pour désactiver la planification
|
||||
@@ -58,7 +54,7 @@ Lorsqu'un workflow est planifié :
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/schedule-disabled.png"
|
||||
src="/static/blocks/schedule-3.png"
|
||||
alt="Planification désactivée"
|
||||
width={500}
|
||||
height={350}
|
||||
|
||||
@@ -4,6 +4,7 @@ title: Webhooks
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
Les webhooks permettent aux services externes de déclencher l'exécution de flux de travail à partir de webhooks externes en envoyant des requêtes HTTP à votre flux de travail. Sim prend en charge deux approches pour les déclencheurs basés sur les webhooks.
|
||||
@@ -12,8 +13,14 @@ Les webhooks permettent aux services externes de déclencher l'exécution de flu
|
||||
|
||||
Le bloc Webhook générique crée un point de terminaison flexible qui peut recevoir n'importe quelle charge utile et déclencher votre flux de travail :
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="webhooks-1.mp4" width={700} height={450} />
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/webhook.png"
|
||||
alt="Generic Webhook Configuration"
|
||||
width={700}
|
||||
height={450}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
### Comment ça fonctionne
|
||||
|
||||
@@ -19,34 +19,6 @@ APIブロックを使用すると、HTTPリクエストを通じてAPIエンド
|
||||
/>
|
||||
</div>
|
||||
|
||||
## 概要
|
||||
|
||||
APIブロックでは以下のことが可能です:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>外部サービスへの接続</strong>: REST APIやWebサービスへのHTTPリクエストを行う
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>データの送受信</strong>: レスポンスの処理や外部ソースからのデータ変換
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>サードパーティプラットフォームの統合</strong>: Stripe、Slack、またはカスタムAPIなどのサービスとの連携
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>認証の処理</strong>: BearerトークンやAPIキーなど、様々な認証方法をサポート
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 動作の仕組み
|
||||
|
||||
APIブロックは構造化されたアプローチでHTTPリクエストを処理します:
|
||||
|
||||
1. **リクエストの設定** - URL、メソッド、ヘッダー、ボディパラメータを設定
|
||||
2. **リクエストの実行** - 指定されたエンドポイントにHTTPリクエストを送信
|
||||
3. **レスポンスの処理** - レスポンスデータ、ステータスコード、ヘッダーの処理
|
||||
4. **エラー処理** - タイムアウト、リトライ、エラー状態の管理
|
||||
|
||||
## 設定オプション
|
||||
|
||||
### URL
|
||||
@@ -145,58 +117,12 @@ if (<api.status> === 200) {
|
||||
}
|
||||
```
|
||||
|
||||
## 入力と出力
|
||||
## 出力
|
||||
|
||||
<Tabs items={['設定', '変数', '結果']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>URL</strong>: リクエストを送信するエンドポイント
|
||||
</li>
|
||||
<li>
|
||||
<strong>メソッド</strong>: HTTPメソッド(GET、POST、PUT、DELETE、PATCH)
|
||||
</li>
|
||||
<li>
|
||||
<strong>クエリパラメータ</strong>: URLパラメータのキーと値のペア
|
||||
</li>
|
||||
<li>
|
||||
<strong>ヘッダー</strong>: 認証とコンテンツタイプのHTTPヘッダー
|
||||
</li>
|
||||
<li>
|
||||
<strong>ボディ</strong>: POST/PUT/PATCHメソッド用のリクエストペイロード
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>api.data</strong>: API呼び出しからのレスポンスボディデータ
|
||||
</li>
|
||||
<li>
|
||||
<strong>api.status</strong>: サーバーから返されたHTTPステータスコード
|
||||
</li>
|
||||
<li>
|
||||
<strong>api.headers</strong>: サーバーからのレスポンスヘッダー
|
||||
</li>
|
||||
<li>
|
||||
<strong>api.error</strong>: リクエストが失敗した場合のエラー詳細
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>レスポンスデータ</strong>: 主要なAPIレスポンスコンテンツ
|
||||
</li>
|
||||
<li>
|
||||
<strong>ステータス情報</strong>: HTTPステータスとエラー詳細
|
||||
</li>
|
||||
<li>
|
||||
<strong>アクセス</strong>: API呼び出し後のブロックで利用可能
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
- **`<api.data>`**: API呼び出しからのレスポンスボディデータ
|
||||
- **`<api.status>`**: HTTPステータスコード
|
||||
- **`<api.headers>`**: レスポンスヘッダー
|
||||
- **`<api.error>`**: リクエストが失敗した場合のエラー詳細
|
||||
|
||||
## 使用例
|
||||
|
||||
|
||||
@@ -20,38 +20,6 @@ import { Image } from '@/components/ui/image'
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Callout>
|
||||
条件ブロックはLLMを必要とせず決定論的な意思決定を可能にし、単純な分岐ロジックに最適です。
|
||||
</Callout>
|
||||
|
||||
## 概要
|
||||
|
||||
条件ブロックでは以下のことが可能です:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>分岐ロジックの作成</strong>:ブール式に基づいてワークフローをルーティング
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>データ駆動型の意思決定</strong>:前のブロックの出力を使用して条件を評価
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>複数のシナリオの処理</strong>:異なるパスを持つ複数の条件を定義
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>決定論的なルーティングの提供</strong>:LLMを必要とせずに決定を行う
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 動作の仕組み
|
||||
|
||||
条件ブロックは順次評価プロセスを通じて動作します:
|
||||
|
||||
1. **式の評価** - 現在のワークフローデータを使用してJavaScript/TypeScriptのブール式を処理
|
||||
2. **結果の決定** - 式の評価に基づいて真または偽を返す
|
||||
3. **ワークフローのルーティング** - 結果に基づいて適切な宛先ブロックに実行を振り分ける
|
||||
4. **コンテキストの提供** - デバッグとモニタリングのための決定に関するメタデータを生成
|
||||
|
||||
## 設定オプション
|
||||
|
||||
### 条件
|
||||
|
||||
@@ -23,54 +23,6 @@ import { Image } from '@/components/ui/image'
|
||||
レスポンスブロックは終端ブロックです - ワークフローの実行を終了し、他のブロックに接続することはできません。
|
||||
</Callout>
|
||||
|
||||
## 概要
|
||||
|
||||
レスポンスブロックでは以下のことが可能です:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>APIレスポンスのフォーマット</strong>:ワークフロー結果を適切なHTTPレスポンスに構造化する
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>ステータスコードの設定</strong>:ワークフロー結果に基づいて適切なHTTPステータスコードを設定する
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>ヘッダーの制御</strong>:APIレスポンスとウェブフックにカスタムヘッダーを追加する
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>データの変換</strong>:ワークフロー変数をクライアントフレンドリーなレスポンス形式に変換する
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 動作の仕組み
|
||||
|
||||
レスポンスブロックはワークフローの実行を完了させます:
|
||||
|
||||
1. **データの収集** - 前のブロックからの変数と出力を収集する
|
||||
2. **レスポンスのフォーマット** - 設定に従ってデータを構造化する
|
||||
3. **HTTP詳細の設定** - ステータスコードとヘッダーを適用する
|
||||
4. **レスポンスの送信** - フォーマットされたレスポンスをAPI呼び出し元に返す
|
||||
|
||||
## レスポンスブロックが必要な場合
|
||||
|
||||
- **APIエンドポイント**:ワークフローがAPI経由で呼び出される場合、レスポンスブロックは返すデータをフォーマットします
|
||||
- **ウェブフック**:確認またはデータを呼び出しシステムに返します
|
||||
- **テスト**:ワークフローをテストする際にフォーマットされた結果を確認できます
|
||||
|
||||
## レスポンスを構築する2つの方法
|
||||
|
||||
### ビルダーモード(推奨)
|
||||
レスポンス構造を構築するためのビジュアルインターフェース:
|
||||
- フィールドのドラッグ&ドロップ
|
||||
- ワークフロー変数の簡単な参照
|
||||
- レスポンス構造のビジュアルプレビュー
|
||||
|
||||
### エディターモード(上級者向け)
|
||||
JSONを直接記述:
|
||||
- レスポンス形式の完全な制御
|
||||
- 複雑なネスト構造のサポート
|
||||
- 動的な値には `<variable.name>` 構文を使用
|
||||
|
||||
## 設定オプション
|
||||
|
||||
### レスポンスデータ
|
||||
|
||||
@@ -21,60 +21,17 @@ import { Video } from '@/components/ui/video'
|
||||
/>
|
||||
</div>
|
||||
|
||||
## 概要
|
||||
## ルーター vs 条件ブロック
|
||||
|
||||
ルーターブロックでは以下のことが可能です:
|
||||
**ルーターを使用する場合:**
|
||||
- AIを活用したコンテンツ分析が必要
|
||||
- 非構造化または様々なコンテンツを扱う場合
|
||||
- 意図ベースのルーティングが必要(例:「サポートチケットを部門にルーティング」)
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>インテリジェントなコンテンツルーティング</strong>:AIを使用して意図とコンテキストを理解
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>動的なパス選択</strong>:非構造化コンテンツ分析に基づいたワークフローのルーティング
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>コンテキストを考慮した判断</strong>:単純なルールを超えたスマートなルーティング選択
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>マルチパス管理</strong>:複数の潜在的な宛先を持つ複雑なワークフローの処理
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## ルーターと条件ブロックの比較
|
||||
|
||||
<Accordions>
|
||||
<Accordion title="ルーターを使用する場合">
|
||||
- AIを活用したコンテンツ分析が必要
|
||||
- 非構造化または様々なコンテンツタイプ
|
||||
- 意図ベースのルーティング(例:「サポートチケットを部門にルーティング」)
|
||||
- コンテキストを考慮した意思決定が必要
|
||||
</Accordion>
|
||||
<Accordion title="条件ブロックを使用する場合">
|
||||
- 単純なルールベースの判断
|
||||
- 構造化データまたは数値比較
|
||||
- 高速で決定論的なルーティングが必要
|
||||
- ブール論理で十分
|
||||
</Accordion>
|
||||
</Accordions>
|
||||
|
||||
## 仕組み
|
||||
|
||||
ルーターブロックは:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>コンテンツを分析</strong>:LLMを使用して入力コンテンツとコンテキストを理解
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>ターゲットを評価</strong>:利用可能な宛先ブロックとコンテンツを比較
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>宛先を選択</strong>:意図に基づいて最適なパスを特定
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>実行をルーティング</strong>:選択されたブロックにワークフローを誘導
|
||||
</Step>
|
||||
</Steps>
|
||||
**条件ブロックを使用する場合:**
|
||||
- 単純なルールベースの判断で十分
|
||||
- 構造化データまたは数値比較を扱う場合
|
||||
- 高速で決定論的なルーティングが必要
|
||||
|
||||
## 設定オプション
|
||||
|
||||
@@ -105,7 +62,7 @@ import { Video } from '@/components/ui/video'
|
||||
**ローカルモデル**: Ollamaで実行されているすべてのモデル
|
||||
|
||||
<div className="w-full max-w-2xl mx-auto overflow-hidden rounded-lg">
|
||||
<Video src="router-model-dropdown.mp4" width={500} height={350} />
|
||||
<Video src="models.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
**推奨**: より正確なルーティング決定のために、GPT-4oやClaude 3.7 Sonnetなどの強力な推論能力を持つモデルを使用してください。
|
||||
@@ -124,58 +81,6 @@ import { Video } from '@/components/ui/video'
|
||||
- **`<router.cost>`**: ルーティングコールのコスト概要(入力、出力、合計)
|
||||
- **`<router.model>`**: 意思決定に使用されたモデル
|
||||
|
||||
## 高度な機能
|
||||
|
||||
### カスタムルーティング基準
|
||||
|
||||
各ターゲットブロックの特定の基準を定義します:
|
||||
|
||||
```javascript
|
||||
// Example routing descriptions
|
||||
Target Block 1: "Technical support issues, API problems, integration questions"
|
||||
Target Block 2: "Billing inquiries, subscription changes, payment issues"
|
||||
Target Block 3: "General questions, feedback, feature requests"
|
||||
```
|
||||
|
||||
## 入力と出力
|
||||
|
||||
<Tabs items={['設定', '変数']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>コンテンツ/プロンプト</strong>: ルーティング判断のために分析するテキスト
|
||||
</li>
|
||||
<li>
|
||||
<strong>ターゲットブロック</strong>: 潜在的な送信先として接続されたブロック
|
||||
</li>
|
||||
<li>
|
||||
<strong>モデル</strong>: ルーティング分析用のAIモデル
|
||||
</li>
|
||||
<li>
|
||||
<strong>APIキー</strong>: 選択したLLMプロバイダーの認証
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>router.prompt</strong>: 使用されたルーティングプロンプトの要約
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.selected_path</strong>: 選択された送信先の詳細
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.tokens</strong>: トークン使用統計
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.cost</strong>: ルーティングコールのコスト概要(入力、出力、合計)
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.model</strong>: 意思決定に使用されたモデル
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## 使用例
|
||||
|
||||
|
||||
@@ -18,22 +18,6 @@ import { Image } from '@/components/ui/image'
|
||||
/>
|
||||
</div>
|
||||
|
||||
## 概要
|
||||
|
||||
待機ブロックでは以下のことが可能です:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>時間遅延の追加</strong>:ワークフローステップ間で実行を一時停止する
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>レート制限の尊重</strong>:制限内に収まるようにAPI呼び出しの間隔を空ける
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>シーケンスのスケジュール</strong>:アクション間に遅延を持つタイムドワークフローを作成する
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 設定
|
||||
|
||||
### 待機時間
|
||||
|
||||
@@ -77,29 +77,6 @@ Simは、ワークフロー内で特定の目的を果たす異なるタイプ
|
||||
|
||||
すべてのブロックは依存関係に基づいて自動的に実行されます - 実行順序やタイミングを手動で管理する必要はありません。
|
||||
|
||||
## 実行トリガー
|
||||
|
||||
ワークフローは、ユースケースに応じていくつかの方法でトリガーできます:
|
||||
|
||||
### 手動テスト
|
||||
ワークフローエディタで「実行」をクリックして、開発中にワークフローをテストします。デバッグや検証に最適です。
|
||||
|
||||
### スケジュール実行
|
||||
cron式を使用して定期的な実行をセットアップします。定期的なデータ処理、レポート、またはメンテナンスタスクに最適です。
|
||||
|
||||
### APIデプロイメント
|
||||
ワークフローをHTTPエンドポイントとしてデプロイし、アプリケーションからプログラム的に呼び出すことができます。
|
||||
|
||||
### Webhook連携
|
||||
GitHub、Stripe、またはカスタムシステムなどの外部サービスからのイベントにリアルタイムで応答します。
|
||||
|
||||
### チャットインターフェース
|
||||
ユーザー向けAIアプリケーション用にカスタムサブドメインでホストされる会話インターフェースを作成します。
|
||||
|
||||
<Callout type="info">
|
||||
各トリガータイプについての詳細は、ドキュメントの[トリガーセクション](/triggers)で詳しく説明しています。
|
||||
</Callout>
|
||||
|
||||
## 実行モニタリング
|
||||
|
||||
ワークフローの実行時、Simは実行プロセスをリアルタイムで可視化します:
|
||||
|
||||
@@ -95,7 +95,7 @@ curl -X POST https://sim.ai/api/workflows/your-workflow-id/execute \
|
||||
|
||||
<div className='flex justify-center my-6'>
|
||||
<Image
|
||||
src='/static/execution/deployment-versions-light.png'
|
||||
src='/static/execution/deployment-versions.png'
|
||||
alt='デプロイメントバージョン一覧表'
|
||||
width={500}
|
||||
height={280}
|
||||
|
||||
@@ -4,6 +4,7 @@ description: カスタムウェブフックを設定して、任意のサービ
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
<BlockInfoCard
|
||||
type="generic_webhook"
|
||||
@@ -22,6 +23,16 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/webhook.png"
|
||||
alt="Webhook Block Configuration"
|
||||
width={500}
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
## 概要
|
||||
|
||||
Generic Webhookブロックは、外部サービスからのWebhookを受信することができます。これはあらゆるJSONペイロードを処理できる柔軟なトリガーであり、専用のSimブロックを持たないサービスとの統合に最適です。
|
||||
|
||||
@@ -11,7 +11,7 @@ import { Video } from '@/components/ui/video'
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/schedule.png"
|
||||
src="/static/blocks/schedule.png"
|
||||
alt="スケジュールブロック"
|
||||
width={500}
|
||||
height={400}
|
||||
@@ -45,10 +45,6 @@ import { Video } from '@/components/ui/video'
|
||||
|
||||
## スケジュールの設定
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="configure-schedule.mp4" width={700} height={450} />
|
||||
</div>
|
||||
|
||||
ワークフローがスケジュールされると:
|
||||
- スケジュールが**有効**になり、次回の実行時間が表示されます
|
||||
- **「スケジュール済み」**ボタンをクリックするとスケジュールを無効にできます
|
||||
@@ -58,7 +54,7 @@ import { Video } from '@/components/ui/video'
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/schedule-disabled.png"
|
||||
src="/static/blocks/schedule-3.png"
|
||||
alt="無効化されたスケジュール"
|
||||
width={500}
|
||||
height={350}
|
||||
|
||||
@@ -4,6 +4,7 @@ title: Webhooks
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
Webhookを使用すると、外部サービスがHTTPリクエストをワークフローに送信することで、外部webhookからワークフロー実行をトリガーできます。Simはwebhookベースのトリガーに対して2つのアプローチをサポートしています。
|
||||
@@ -12,8 +13,14 @@ Webhookを使用すると、外部サービスがHTTPリクエストをワーク
|
||||
|
||||
汎用Webhookブロックは、あらゆるペイロードを受信してワークフローをトリガーできる柔軟なエンドポイントを作成します:
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="webhooks-1.mp4" width={700} height={450} />
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/webhook.png"
|
||||
alt="Generic Webhook Configuration"
|
||||
width={700}
|
||||
height={450}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
### 仕組み
|
||||
|
||||
@@ -19,34 +19,6 @@ API 模块使您能够通过 HTTP 请求使用 API 端点将工作流连接到
|
||||
/>
|
||||
</div>
|
||||
|
||||
## 概述
|
||||
|
||||
API 模块使您能够:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>连接外部服务</strong>:向 REST API 和 Web 服务发出 HTTP 请求
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>发送和接收数据</strong>:处理响应并转换来自外部来源的数据
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>集成第三方平台</strong>:连接 Stripe、Slack 或自定义 API 等服务
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>处理身份验证</strong>:支持包括 Bearer 令牌和 API 密钥在内的多种身份验证方法
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 工作原理
|
||||
|
||||
API 模块通过结构化的方法处理 HTTP 请求:
|
||||
|
||||
1. **配置请求** - 设置 URL、方法、头信息和正文参数
|
||||
2. **执行请求** - 向指定端点发送 HTTP 请求
|
||||
3. **处理响应** - 处理响应数据、状态码和头信息
|
||||
4. **错误处理** - 管理超时、重试和错误情况
|
||||
|
||||
## 配置选项
|
||||
|
||||
### URL
|
||||
@@ -145,58 +117,12 @@ if (<api.status> === 200) {
|
||||
}
|
||||
```
|
||||
|
||||
## 输入和输出
|
||||
## 输出
|
||||
|
||||
<Tabs items={['配置', '变量', '结果']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>URL</strong>:要发送请求的端点
|
||||
</li>
|
||||
<li>
|
||||
<strong>方法</strong>:HTTP 方法(GET、POST、PUT、DELETE、PATCH)
|
||||
</li>
|
||||
<li>
|
||||
<strong>查询参数</strong>:URL 参数的键值对
|
||||
</li>
|
||||
<li>
|
||||
<strong>请求头</strong>:用于身份验证和内容类型的 HTTP 请求头
|
||||
</li>
|
||||
<li>
|
||||
<strong>请求体</strong>:POST/PUT/PATCH 方法的请求负载
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>api.data</strong>:API 调用的响应体数据
|
||||
</li>
|
||||
<li>
|
||||
<strong>api.status</strong>:服务器返回的 HTTP 状态码
|
||||
</li>
|
||||
<li>
|
||||
<strong>api.headers</strong>:服务器返回的响应头
|
||||
</li>
|
||||
<li>
|
||||
<strong>api.error</strong>:如果请求失败,包含错误详情
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>响应数据</strong>:主要的 API 响应内容
|
||||
</li>
|
||||
<li>
|
||||
<strong>状态信息</strong>:HTTP 状态和错误详情
|
||||
</li>
|
||||
<li>
|
||||
<strong>访问</strong>:在 API 调用后可用的模块
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
- **`<api.data>`**: API 调用的响应体数据
|
||||
- **`<api.status>`**: HTTP 状态码
|
||||
- **`<api.headers>`**: 响应头
|
||||
- **`<api.error>`**: 如果请求失败,包含错误详情
|
||||
|
||||
## 示例用例
|
||||
|
||||
|
||||
@@ -20,38 +20,6 @@ import { Image } from '@/components/ui/image'
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Callout>
|
||||
条件模块支持确定性决策,无需依赖 LLM,非常适合简单的分支逻辑。
|
||||
</Callout>
|
||||
|
||||
## 概述
|
||||
|
||||
条件模块可以让您:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>创建分支逻辑</strong>:基于布尔表达式引导工作流
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>做出数据驱动的决策</strong>:使用前一个模块的输出评估条件
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>处理多种场景</strong>:定义多个条件并设置不同路径
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>提供确定性路由</strong>:无需依赖 LLM 即可做出决策
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 工作原理
|
||||
|
||||
条件模块通过以下顺序评估过程运行:
|
||||
|
||||
1. **评估表达式** - 使用当前工作流数据处理 JavaScript/TypeScript 布尔表达式
|
||||
2. **确定结果** - 根据表达式评估返回 true 或 false
|
||||
3. **引导工作流** - 根据结果将执行引导到相应的目标模块
|
||||
4. **提供上下文** - 生成关于决策的元数据以便调试和监控
|
||||
|
||||
## 配置选项
|
||||
|
||||
### 条件
|
||||
|
||||
@@ -23,54 +23,6 @@ import { Image } from '@/components/ui/image'
|
||||
响应模块是终端模块——它们结束工作流的执行,无法连接到其他模块。
|
||||
</Callout>
|
||||
|
||||
## 概述
|
||||
|
||||
响应模块可以让您:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>格式化 API 响应</strong>:将工作流结果结构化为正确的 HTTP 响应
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>设置状态码</strong>:根据工作流结果配置适当的 HTTP 状态码
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>控制头信息</strong>:为 API 响应和 Webhooks 添加自定义头信息
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>转换数据</strong>:将工作流变量转换为客户端友好的响应格式
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 工作原理
|
||||
|
||||
响应模块完成工作流的执行:
|
||||
|
||||
1. **收集数据** - 收集前面模块的变量和输出
|
||||
2. **格式化响应** - 根据您的配置结构化数据
|
||||
3. **设置 HTTP 详细信息** - 应用状态码和头信息
|
||||
4. **发送响应** - 将格式化的响应返回给 API 调用方
|
||||
|
||||
## 何时需要响应模块
|
||||
|
||||
- **API 端点**:当您的工作流通过 API 调用时,响应模块会格式化返回数据
|
||||
- **Webhooks**:将确认或数据返回给调用系统
|
||||
- **测试**:在测试工作流时查看格式化的结果
|
||||
|
||||
## 构建响应的两种方式
|
||||
|
||||
### 构建器模式(推荐)
|
||||
用于构建响应结构的可视化界面:
|
||||
- 拖放字段
|
||||
- 轻松引用工作流变量
|
||||
- 响应结构的可视化预览
|
||||
|
||||
### 编辑器模式(高级)
|
||||
直接编写 JSON:
|
||||
- 完全控制响应格式
|
||||
- 支持复杂的嵌套结构
|
||||
- 使用 `<variable.name>` 语法表示动态值
|
||||
|
||||
## 配置选项
|
||||
|
||||
### 响应数据
|
||||
|
||||
@@ -21,60 +21,17 @@ import { Video } from '@/components/ui/video'
|
||||
/>
|
||||
</div>
|
||||
|
||||
## 概述
|
||||
## 路由器 vs 条件模块
|
||||
|
||||
路由器模块可以让您:
|
||||
**使用路由器时:**
|
||||
- 需要 AI 驱动的内容分析
|
||||
- 处理非结构化或多样化的内容
|
||||
- 需要基于意图的路由(例如,"将支持票据路由到部门")
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>智能内容路由</strong>:使用 AI 理解意图和上下文
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>动态路径选择</strong>:基于非结构化内容分析路由工作流
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>上下文感知决策</strong>:做出超越简单规则的智能路由选择
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>多路径管理</strong>:处理具有多个潜在目的地的复杂工作流
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 路由器模块与条件模块的对比
|
||||
|
||||
<Accordions>
|
||||
<Accordion title="何时使用路由器">
|
||||
- 需要 AI 驱动的内容分析
|
||||
- 非结构化或多样化的内容类型
|
||||
- 基于意图的路由(例如,“将支持票据路由到部门”)
|
||||
- 需要上下文感知的决策
|
||||
</Accordion>
|
||||
<Accordion title="何时使用条件模块">
|
||||
- 简单的基于规则的决策
|
||||
- 结构化数据或数值比较
|
||||
- 需要快速、确定性的路由
|
||||
- 布尔逻辑足够
|
||||
</Accordion>
|
||||
</Accordions>
|
||||
|
||||
## 工作原理
|
||||
|
||||
路由器模块:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>分析内容</strong>:使用 LLM 理解输入内容和上下文
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>评估目标</strong>:将内容与可用的目标模块进行比较
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>选择目标</strong>:根据意图识别最合适的路径
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>执行路由</strong>:将工作流引导到选定的模块
|
||||
</Step>
|
||||
</Steps>
|
||||
**使用条件模块时:**
|
||||
- 简单的基于规则的决策足够
|
||||
- 处理结构化数据或数值比较
|
||||
- 需要快速、确定性的路由
|
||||
|
||||
## 配置选项
|
||||
|
||||
@@ -105,7 +62,7 @@ Router 可以选择的目标模块。Router 会自动检测连接的模块,但
|
||||
**本地模型**:任何运行在 Ollama 上的模型
|
||||
|
||||
<div className="w-full max-w-2xl mx-auto overflow-hidden rounded-lg">
|
||||
<Video src="router-model-dropdown.mp4" width={500} height={350} />
|
||||
<Video src="models.mp4" width={500} height={350} />
|
||||
</div>
|
||||
|
||||
**推荐**:使用具有强大推理能力的模型,例如 GPT-4o 或 Claude 3.7 Sonnet,以获得更准确的路由决策。
|
||||
@@ -124,58 +81,6 @@ Router 做出决策后,您可以访问其输出:
|
||||
- **`<router.cost>`**:路由调用的成本摘要(输入、输出、总计)
|
||||
- **`<router.model>`**:用于决策的模型
|
||||
|
||||
## 高级功能
|
||||
|
||||
### 自定义路由标准
|
||||
|
||||
为每个目标模块定义特定的标准:
|
||||
|
||||
```javascript
|
||||
// Example routing descriptions
|
||||
Target Block 1: "Technical support issues, API problems, integration questions"
|
||||
Target Block 2: "Billing inquiries, subscription changes, payment issues"
|
||||
Target Block 3: "General questions, feedback, feature requests"
|
||||
```
|
||||
|
||||
## 输入和输出
|
||||
|
||||
<Tabs items={['Configuration', 'Variables']}>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>内容/提示</strong>:用于分析路由决策的文本
|
||||
</li>
|
||||
<li>
|
||||
<strong>目标块</strong>:作为潜在目的地的连接块
|
||||
</li>
|
||||
<li>
|
||||
<strong>模型</strong>:用于路由分析的 AI 模型
|
||||
</li>
|
||||
<li>
|
||||
<strong>API 密钥</strong>:选定 LLM 提供商的身份验证
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<ul className="list-disc space-y-2 pl-6">
|
||||
<li>
|
||||
<strong>router.prompt</strong>:使用的路由提示摘要
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.selected_path</strong>:选择的目的地详情
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.tokens</strong>:令牌使用统计
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.cost</strong>:路由调用的成本摘要(输入、输出、总计)
|
||||
</li>
|
||||
<li>
|
||||
<strong>router.model</strong>:用于决策的模型
|
||||
</li>
|
||||
</ul>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## 示例用例
|
||||
|
||||
|
||||
@@ -18,22 +18,6 @@ import { Image } from '@/components/ui/image'
|
||||
/>
|
||||
</div>
|
||||
|
||||
## 概述
|
||||
|
||||
等待模块可以让您:
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
<strong>添加时间延迟</strong>:在工作流步骤之间暂停执行
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>遵守速率限制</strong>:间隔 API 调用以保持在限制范围内
|
||||
</Step>
|
||||
<Step>
|
||||
<strong>安排序列</strong>:创建带有操作间延迟的定时工作流
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 配置
|
||||
|
||||
### 等待时间
|
||||
|
||||
@@ -77,29 +77,6 @@ Sim 提供了不同类型的块,用于在工作流中实现特定功能:
|
||||
|
||||
所有块都会根据其依赖关系自动执行——您无需手动管理执行顺序或时间。
|
||||
|
||||
## 执行触发器
|
||||
|
||||
根据您的使用场景,工作流可以通过多种方式触发:
|
||||
|
||||
### 手动测试
|
||||
在工作流编辑器中点击“运行”以在开发过程中测试您的工作流。非常适合调试和验证。
|
||||
|
||||
### 定时执行
|
||||
使用 cron 表达式设置定期执行。非常适合定期数据处理、报告或维护任务。
|
||||
|
||||
### API 部署
|
||||
将工作流部署为 HTTP 端点,可从您的应用程序中以编程方式调用。
|
||||
|
||||
### Webhook 集成
|
||||
实时响应来自外部服务(如 GitHub、Stripe 或自定义系统)的事件。
|
||||
|
||||
### 聊天界面
|
||||
为面向用户的 AI 应用程序创建托管在自定义子域上的对话界面。
|
||||
|
||||
<Callout type="info">
|
||||
了解更多关于每种触发器类型的信息,请参阅文档中的[触发器部分](/triggers)。
|
||||
</Callout>
|
||||
|
||||
## 执行监控
|
||||
|
||||
当工作流运行时,Sim 提供对执行过程的实时可见性:
|
||||
|
||||
@@ -95,7 +95,7 @@ curl -X POST https://sim.ai/api/workflows/your-workflow-id/execute \
|
||||
|
||||
<div className='flex justify-center my-6'>
|
||||
<Image
|
||||
src='/static/execution/deployment-versions-light.png'
|
||||
src='/static/execution/deployment-versions.png'
|
||||
alt='部署版本表'
|
||||
width={500}
|
||||
height={280}
|
||||
|
||||
@@ -4,6 +4,7 @@ description: 通过配置自定义 webhook,从任何服务接收 webhook。
|
||||
---
|
||||
|
||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
import { Image } from '@/components/ui/image'
|
||||
|
||||
<BlockInfoCard
|
||||
type="generic_webhook"
|
||||
@@ -22,6 +23,16 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||
</svg>`}
|
||||
/>
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/webhook.png"
|
||||
alt="Webhook Block Configuration"
|
||||
width={500}
|
||||
height={400}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
## 概述
|
||||
|
||||
通用 Webhook 模块允许您接收来自任何外部服务的 webhook。这是一个灵活的触发器,可以处理任何 JSON 负载,非常适合与没有专用 Sim 模块的服务集成。
|
||||
|
||||
@@ -11,7 +11,7 @@ import { Video } from '@/components/ui/video'
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/schedule.png"
|
||||
src="/static/blocks/schedule.png"
|
||||
alt="计划模块"
|
||||
width={500}
|
||||
height={400}
|
||||
@@ -45,10 +45,6 @@ import { Video } from '@/components/ui/video'
|
||||
|
||||
## 配置计划
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="configure-schedule.mp4" width={700} height={450} />
|
||||
</div>
|
||||
|
||||
当工作流被计划时:
|
||||
- 计划变为**激活**状态,并显示下一次执行时间
|
||||
- 点击 **"已计划"** 按钮可以停用计划
|
||||
@@ -58,7 +54,7 @@ import { Video } from '@/components/ui/video'
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/schedule-disabled.png"
|
||||
src="/static/blocks/schedule-3.png"
|
||||
alt="停用的计划"
|
||||
width={500}
|
||||
height={350}
|
||||
|
||||
@@ -4,6 +4,7 @@ title: Webhooks
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
import { Image } from '@/components/ui/image'
|
||||
import { Video } from '@/components/ui/video'
|
||||
|
||||
Webhook 允许外部服务通过发送 HTTP 请求到您的工作流,从外部触发工作流的执行。Sim 支持两种基于 Webhook 的触发方式。
|
||||
@@ -12,8 +13,14 @@ Webhook 允许外部服务通过发送 HTTP 请求到您的工作流,从外部
|
||||
|
||||
通用 Webhook 模块创建了一个灵活的端点,可以接收任何有效负载并触发您的工作流:
|
||||
|
||||
<div className="mx-auto w-full overflow-hidden rounded-lg">
|
||||
<Video src="webhooks-1.mp4" width={700} height={450} />
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
src="/static/blocks/webhook.png"
|
||||
alt="Generic Webhook Configuration"
|
||||
width={700}
|
||||
height={450}
|
||||
className="my-6"
|
||||
/>
|
||||
</div>
|
||||
|
||||
### 工作原理
|
||||
|
||||
|
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 153 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 34 KiB |
BIN
apps/docs/public/static/blocks/guardrails-2.png
Normal file
|
After Width: | Height: | Size: 209 KiB |
|
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 59 KiB |
BIN
apps/docs/public/static/blocks/hitl-1.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
apps/docs/public/static/blocks/hitl-2.png
Normal file
|
After Width: | Height: | Size: 192 KiB |
|
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 172 KiB |
|
Before Width: | Height: | Size: 178 KiB After Width: | Height: | Size: 176 KiB |
|
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 185 KiB |
|
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 185 KiB |
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 162 KiB After Width: | Height: | Size: 149 KiB |
|
Before Width: | Height: | Size: 177 KiB After Width: | Height: | Size: 139 KiB |
|
Before Width: | Height: | Size: 151 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 33 KiB |
BIN
apps/docs/public/static/blocks/schedule-2.png
Normal file
|
After Width: | Height: | Size: 138 KiB |
BIN
apps/docs/public/static/blocks/schedule-3.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
apps/docs/public/static/blocks/schedule.png
Normal file
|
After Width: | Height: | Size: 38 KiB |