# jinba > This file is very large and may be truncated. For an index of this content, please refer to https://docs.jinba.io/llms.txt instead. # What is Jinba? Source: https://docs.jinba.io/en/introduction Build, run, and deploy AI-powered workflows with natural language Jinba is a platform that enables you to build, run, and deploy reusable business workflows with AI—all in one seamless experience. ![Jinba Overview](https://mintcdn.com/jinba/B0KuFPdq9oF6s05P/en/images/what_is_jinba_en.png?fit=max\&auto=format\&n=B0KuFPdq9oF6s05P\&q=85\&s=29eec4094778d39d62f20f38c6155a2f) Jinba consists of three products: ![Jinba flow logo](/logo/jinba_flow_logo_with_text.svg) ### [Build with AI](./pages/basics/what-is-jinba-flow) **Design and build** workflows. * Build tools via chat-based interface * Review and edit with flowcharts * Integrate with external services * Publish as APIs or batch processes ![Jinba app logo](/logo/jinba_app_logo_with_text.svg) ### [Use with AI](./pages/jinba_app/introduction) **Invoke and execute** workflows and services. * Execute external services via chat * Call Jinba Flow workflows easily * Auto-generate input forms from data * AI-powered via MCP integration ![Jinba toolbox logo](/logo/jinba_toolbox_logo_with_text.svg) ### [Tools for AI Beta](./pages/toolbox/what-is-jinba-toolbox) **Manage and execute** AI agent tools. * Centralized tool registry * Sandbox execution in containers * REST API, SDK, and MCP support * Semver versioning and publishing *** ## Jinba Flow ![Jinba Flow Editor](https://mintcdn.com/jinba/B0KuFPdq9oF6s05P/en/images/flow_editor_en.png?fit=max\&auto=format\&n=B0KuFPdq9oF6s05P\&q=85\&s=89b52eec9376c61b2da96cc7b0b27cff) Jinba Flow lets you design and build workflows. Generate flows automatically through chat, then visually review and edit them with an intuitive flowchart interface. Workflows can be published as APIs or batch processes for easy reuse. > [card] [What is Jinba Flow?](./pages/basics/what-is-jinba-flow) > > Detailed features of Jinba Flow, workflow automation in 3 steps, and use cases *** ## Jinba App Jinba App is the product for invoking and executing your created workflows and external services. Execute via chat, with auto-generated input forms (UI) when needed, providing a safe execution experience even for non-engineers. Through MCP (Model Context Protocol), AI can access workflows built in Jinba Flow and external services to achieve user goals. > [card] [What is Jinba App?](./pages/jinba_app/introduction) > > Learn about Jinba App's screen layout, main features, and how to use MCP Its successor, **Jinba App Neo** Beta, is also available — an agent-centric AI platform built on Anthropic's Claude. Create an agent per use case, attach skills, connectors, and knowledge to it, and put it to work through chat. > [card] [What is Jinba App Neo?](./pages/jinba_app_neo/introduction) > > Agents, skills, connectors, knowledge, and memory in the next-generation Jinba App *** ## Jinba Toolbox Beta Jinba Toolbox is a centralized tool management and execution platform for AI agents. Register, version, and share tools across your organization, then execute them in isolated sandbox environments. > [card] [What is Jinba Toolbox?](./pages/toolbox/what-is-jinba-toolbox) > > Learn about Jinba Toolbox's centralized registry, sandbox execution, and AI integration # Execution Model Source: https://docs.jinba.io/en/pages/architecture/execution-model How workflows execute from trigger to completion Understanding the execution model helps you design reliable workflows and debug issues effectively. ## Build Time vs Run Time Workflows have two distinct phases: > [card] Build Time > > Design your workflow in the editor. Define steps, configure tools, and set up dependencies. > [card] Run Time > > The runner interprets and executes the manifest. Steps run in dependency order as data flows through. ## Execution Timeline When a workflow runs, it follows this timeline: **1. Trigger** Execution begins via API call, schedule, MCP, or manual run **2. Validate** Input parameters validated, manifest loaded **3. Execute** Steps run according to dependency graph **4. Handle** Errors caught, retries attempted if configured **5. Return** Final result returned to caller ## Step Execution Patterns > [card] Sequential > > Steps with dependencies run one after another > [card] Parallel > > Independent steps run simultaneously > [card] Conditional > > Steps run only when `when` condition is true > [card] Loop > > Steps repeat for each item via `forEach` ### Sequential Execution Steps with `needs` wait for their dependencies: The `TOOL_A`, `TOOL_B`, and `TOOL_C` IDs below illustrate execution order. Replace them with tool IDs from the [tool catalog](/en/pages/tools/index). ```yaml theme={null} steps: - id: step_a tool: TOOL_A - id: step_b tool: TOOL_B needs: [step_a] # Waits for step_a - id: step_c tool: TOOL_C needs: [step_b] # Waits for step_b ``` **Execution order:** `step_a` → `step_b` → `step_c` ### Parallel Execution Steps without shared dependencies run in parallel: ```yaml theme={null} steps: - id: input tool: INPUT_TEXT - id: branch_a tool: TOOL_A needs: [input] - id: branch_b tool: TOOL_B needs: [input] # Runs parallel with branch_a - id: merge tool: TOOL_C needs: [branch_a, branch_b] # Waits for both ``` **Execution order:** `input` → (`branch_a` ∥ `branch_b`) → `merge` ### Conditional Execution Use `when` for conditional logic: ```yaml theme={null} steps: - id: message tool: INPUT_TEXT input: - name: value value: "The server is down" - id: classify tool: OPENAI_INVOKE needs: [message] input: - name: prompt value: "Classify as 'urgent' or 'normal': {{steps.message.result}}" - id: urgent_handler tool: SLACK_POST_MESSAGE needs: [classify] config: - name: token value: "{{secrets.SLACK_BOT_TOKEN}}" when: "'{{steps.classify.result.content}}' == 'urgent'" input: - name: channel value: "#alerts" - name: text value: "URGENT: {{steps.message.result}}" - id: normal_handler tool: GMAIL_SEND_MESSAGE needs: [classify] config: - name: token value: "{{secrets.GMAIL_OAUTH_TOKEN}}" when: "'{{steps.classify.result.content}}' == 'normal'" input: - name: user_id value: "me" - name: to_email value: "team@example.com" - name: subject value: "New message" - name: body value: "{{steps.message.result}}" ``` Only one handler executes based on the classification result. ### Loop Execution (forEach) Process collections with `forEach`: ```yaml theme={null} steps: - id: get_items tool: INPUT_JSON input: - name: value value: '[{"name": "Alice"}, {"name": "Bob"}, {"name": "Carol"}]' - id: greet_each tool: OPENAI_INVOKE forEach: "{{steps.get_items.result}}" needs: [get_items] input: - name: prompt value: "Write a greeting for {{item.name}}" ``` The step executes once for each item in the collection. ## Failure Modes | Failure Type | Cause | Handling | | - | - | - | | **Validation Error** | Invalid input parameters or manifest | Execution stops immediately | | **Tool Error** | External service failure or timeout | Step marked failed | | **Timeout Error** | Step exceeds configured time limit | Step terminated | | **Dependency Error** | Required step failed or was cancelled | Dependent steps cancelled | | **Condition Error** | `when` expression cannot be evaluated | Step marked failed | ## Step Status States Each step transitions through these states: | Status | Description | | - | - | | **Pending** | Waiting for dependencies to complete | | **Running** | Currently executing | | **Success** | Completed successfully | | **Failed** | Execution failed with error | | **Skipped** | `when` condition false, or every needed step was skipped | | **Cancelled** | A needed step failed or was cancelled | ## Variable Resolution Variables are resolved at execution time: | Pattern | Resolved To | | - | - | | `{{steps.step_id.result}}` | Full result of completed step | | `{{steps.step_id.result.field}}` | Specific field from step result | | `{{secrets.KEY_NAME}}` | Credential from workspace secrets | | `{{item}}` | Current item in forEach loop | | `{{item.field}}` | Field from current loop item | ## Error Handling Best Practices 1. **Validate Early**: Use INPUT\_\* tools to validate data at the start 2. **Check Outputs**: Add validation steps after critical operations 3. **Use Conditions**: Handle different outcomes with `when` clauses 4. **Design for Failure**: Consider what happens when external services fail 5. **Review History**: Use execution history to analyze failures ## Debugging Tips | Issue | Solution | | - | - | | Step not running | Check `needs` dependencies are satisfied | | Wrong data | Verify variable reference syntax | | Condition not working | Test `when` expression with actual values | | Loop not iterating | Ensure `forEach` target is an array | | Timeout | Increase step timeout or optimize logic | ## What's Next? > [card] [Debug Workflows](/en/pages/basics/debug) > > Learn debugging techniques > [card] [YAML Reference](/en/pages/basics/manifest) > > Complete manifest syntax reference # System Architecture Source: https://docs.jinba.io/en/pages/architecture/system-architecture How Jinba Flow components work together Jinba Flow consists of four main components that work together to enable workflow automation. ## Component Overview > [card] Flow Editor > > Visual interface for creating workflows using Chat, Graph, or YAML > [card] Manifest > > YAML representation of your workflow definition > [card] Runner > > Execution engine that processes manifests and runs steps > [card] API / MCP > > External interfaces for triggering and integrating workflows ## Data Flow ```mermaid theme={null} flowchart LR Editor["Editor
(Design)"] --> Manifest["Manifest
(YAML)"] Manifest --> Runner["Runner
(Execute)"] Runner --> API["API / MCP
(Deploy)"] API -.->|Feedback Loop| Editor ``` ## Component Details ### 1. Flow Editor (Design Time) The Flow Editor provides three methods to create workflows: | Method | Interface | Best For | | - | - | - | | **Chat Panel** | Natural language | Quick prototyping, non-technical users | | **Graph Editor** | Visual drag-and-drop | Understanding flow structure | | **YAML Panel** | Direct code editing | Precise control, version control | All three methods produce the same output: a **Manifest**. ### 2. Manifest (Bridge) The Manifest is a YAML document that defines your workflow: ```yaml theme={null} steps: - id: step_id tool: TOOL_NAME input: - name: param value: "{{reference}}" needs: [dependency_step] when: "condition" forEach: "{{collection}}" ``` | Field | Purpose | | - | - | | `id` | Unique identifier for the step | | `tool` | The tool to execute | | `input` | Parameters passed to the tool | | `needs` | Dependencies on other steps | | `when` | Conditional execution | | `forEach` | Loop over a collection | ### 3. Runner (Execution Time) The Runner interprets manifests and executes workflows: **1. Parse** Load and validate the manifest YAML **2. Resolve** Build dependency graph from `needs` fields **3. Execute** Run steps in topological order, parallelizing when possible **4. Handle** Manage errors, retries, and conditional skips **5. Return** Collect results and return to caller **Key Capabilities:** * Parallel execution of independent steps * Variable resolution (`{{steps.*.result}}`) * Credential injection from workspace secrets * Timeout and retry management ### 4. API / MCP (Deployment) Published workflows expose two integration interfaces: | Interface | Endpoint | Use Case | | - | - | - | | **REST API** | `POST /api/v2/external/flows/{flowId}/published-run` | Programmatic integration | | **MCP Server** | Model Context Protocol | AI agent tools | **Authentication:** * API Key required for all external calls * Keys scoped to workspace * Rate limiting applied ## Execution Flow **1. Trigger** API call, schedule, MCP invocation, or manual run starts execution **2. Load** Runner loads the published manifest version **3. Validate** Input parameters validated against defined schema **4. Execute** Steps run according to dependency graph **5. Return** Results returned via API response or MCP result ## Security Boundaries | Boundary | Protection | | - | - | | **Editor → Manifest** | Schema validation prevents invalid YAML | | **API → Runner** | API key authentication required | | **Runner → Tools** | Credential isolation per workspace | | **Runner → External** | Secure sandbox execution environment | ## Workspace Isolation Each workspace maintains: * **Credentials**: API keys and OAuth tokens * **Flows**: Workflow definitions * **Versions**: Published snapshots * **Execution History**: Run logs and artifacts Workspaces are completely isolated from each other. ## What's Next? > [card] [Execution Model](./execution-model) > > Deep dive into how steps execute > [card] [API Reference](/en/pages/basics/api) > > Learn about API endpoints # Run a Published Jinba Flow with the REST API Source: https://docs.jinba.io/en/pages/basics/api Call a published Jinba Flow with the REST API, pass flow inputs, and inspect run results. Publish a flow, then call the endpoint shown in its **Triggers** panel. The panel provides the exact URL and secret for that flow. ![The Triggers panel showing the published flow endpoint and secret key](https://mintcdn.com/jinba/B0KuFPdq9oF6s05P/en/pages/basics/images/screens/triggers.png?fit=max\&auto=format\&n=B0KuFPdq9oF6s05P\&q=85\&s=789de4c3fe2c17e5753fbff76d7e02ff) The Triggers panel shows the published flow endpoint, its secret key, and a ready-to-copy cURL request ## Before you start * Publish the flow you want to call. * Add an `INPUT_*` step for each value the caller must provide. The step ID is the argument name. * Copy the endpoint and secret key from the flow's **Triggers** panel. Treat the secret key like a password. Store it securely and do not commit it to source control. ## Run a flow synchronously A synchronous request waits for the flow to finish. The API returns the run ID, status, and step outputs. Set the URL and secret to the values shown in the Triggers panel, then send a request: ```bash theme={null} export JINBA_FLOW_URL="https://api.jinba.io/api/v2/external/flows/FLOW_ID/published-run" export JINBA_FLOW_KEY="YOUR_FLOW_SECRET" curl -X POST "$JINBA_FLOW_URL" \ -H "Authorization: Bearer $JINBA_FLOW_KEY" \ -H "Content-Type: application/json" \ -d '{ "args": [ { "name": "name", "value": "Jinba" } ], "mode": "sync" }' ``` Replace `FLOW_ID` and `YOUR_FLOW_SECRET` with the values from the panel. The `name` argument must match the ID of an input step in the published flow. The `mode` field is optional; it defaults to `sync`. A successful response has `status: "success"`. It includes an `id` for the run and `stepOutputs` keyed by step ID. Each tool's result shape depends on that tool. If the flow uses `OUTPUT_*` steps, their values also appear in `result`. A run that fails returns `status: "failed"`; check `error` and the failed step's entry in `stepOutputs`. ## Call the flow from code These examples read the URL and secret from the same `JINBA_FLOW_URL` and `JINBA_FLOW_KEY` environment variables. **Python** (with the `requests` package): ```python theme={null} import os import requests response = requests.post( os.environ["JINBA_FLOW_URL"], headers={"Authorization": f"Bearer {os.environ['JINBA_FLOW_KEY']}"}, json={ "args": [{"name": "name", "value": "Jinba"}], "mode": "sync", }, ) response.raise_for_status() run = response.json() print(run["id"], run["status"]) print(run["stepOutputs"]) ``` **JavaScript** (Node.js 18 or later, run as an ES module such as `call-flow.mjs`): ```javascript theme={null} const response = await fetch(process.env.JINBA_FLOW_URL, { method: "POST", headers: { Authorization: `Bearer ${process.env.JINBA_FLOW_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ args: [{ name: "name", value: "Jinba" }], mode: "sync", }), }); if (!response.ok) { throw new Error(`Flow request failed: ${response.status} ${await response.text()}`); } const run = await response.json(); console.log(run.id, run.status, run.stepOutputs); ``` Both print the run ID, its status, and the step outputs. A non-2xx response raises an error instead. ## Pass numbers, JSON, and webhook payloads Every argument `value` must be a string. The API rejects a request that sends a number, boolean, or object as a value. Send numbers and booleans as text, such as `"10"` or `"true"`, and serialize structured data to a JSON string. For example, a webhook receiver can forward the event it received to a flow. Here, `webhook_data` is the ID of an `INPUT_*` step in the flow: ```javascript theme={null} export async function forwardToFlow(event) { const response = await fetch(process.env.JINBA_FLOW_URL, { method: "POST", headers: { Authorization: `Bearer ${process.env.JINBA_FLOW_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ args: [{ name: "webhook_data", value: JSON.stringify(event) }], mode: "async", }), }); if (!response.ok) { throw new Error(`Flow request failed: ${response.status}`); } return response.json(); } ``` The `webhook_data` step receives the whole event as JSON text. Async mode lets the receiver respond without waiting for the flow to finish; the returned `id` identifies the run. To hand the flow a file already stored in Jinba Flow, pass `jinbaflow://` as the value of an `INPUT_FILE` step. The server resolves it to a download URL before the flow runs. Only files in the flow's own workspace resolve, whether the reference is a run argument or is saved in the flow's steps and whatever starts the run (an API key, a webhook, a Slack message, a schedule). A reference to a file in another workspace reaches the flow unchanged, even if the flow's owner or the key's creator can access that workspace. ## Run a flow asynchronously For a flow that should continue in the background, set `mode` to `async`: ```json theme={null} { "args": [ { "name": "name", "value": "Jinba" } ], "mode": "async" } ``` The response includes the run `id` and `status: "running"`. To retrieve the run record and its output, send an authenticated `GET` request to: ```text theme={null} https://api.jinba.io/api/v2/external/flow-runs/RUN_ID ``` This lookup uses a workspace-scoped API key. The flow-specific secret from the Triggers panel is for calling the published flow; it does not authorize workspace run-history access. A workspace API key works only on its own workspace. It cannot reach other workspaces, organization settings, or your account, even if you are a member of them, and `GET /api/v2/workspaces` (the list of your workspaces) answers `404` to it. Within its workspace it also cannot manage API keys, members, invites, or access settings, change the workspace's visibility, share flows or publish templates, act on approval requests, use the chat relay, or archive, freeze, restore, delete, or move the workspace to another organization. Sign in to perform those operations. ## Check a failed request * **401 Unauthorized:** Check that the request includes the flow secret in the `Authorization: Bearer` header. * **404 Not Found:** Confirm the flow ID is correct and the flow has a published version. * **The flow runs but an input is empty:** Use the exact ID of the `INPUT_*` step as the `name` in `args`. * **A step returns an error:** Inspect that step's output and check its tool documentation for required inputs, credentials, and permissions. See [Debug a failed run](./debug) to inspect step errors in Jinba Flow. # Archive Feature Source: https://docs.jinba.io/en/pages/basics/archive How to archive and restore flows # Archive Feature The archive feature allows you to hide flows that are no longer needed without deleting them permanently. Archived flows can be restored within 30 days, so you don't have to worry about accidental deletion. ## What is Archive Archive is a "soft delete" feature for flows. Instead of permanently deleting a flow, it temporarily hides it so you can restore it if needed later. ### Characteristics of Archived Flows * **Cannot edit**: Flows cannot be edited while archived * **Cannot run**: Flow execution is disabled while archived * **Can view**: Flow contents can still be viewed * **Restorable**: Can be restored to its original state within 30 days ### What Happens When You Archive * **Removed from MCP**: If registered as an MCP tool, it will be automatically removed * **Unpublished**: Published flows will be unpublished ### Permanent Deletion After 30 Days Archived flows are **permanently deleted after 30 days**. Please note that restoration is not possible after permanent deletion. ## Archiving a Flow 1. Find the flow you want to archive in the flow list 2. Click the menu (...) in the top right of the flow card 3. Select "Move to Trash" 4. Click "Move to Trash" in the confirmation dialog You can also archive multiple flows at once: 1. Select the checkboxes of the flows you want to archive 2. Click "Delete" from the bulk action menu that appears at the top 3. Click "Move to Trash" in the confirmation dialog ## Viewing Archived Flows Archived flows are not displayed in the list by default. To view them: 1. Click the filter button on the flow list page 2. Check "Include items in trash" in the "Trash" section 3. Archived flows will appear in the list, with a banner that says you are viewing items in trash Archived flows are displayed with an "Archived" badge. "Hide Trash" in the banner returns to the normal list. ## Restoring a Flow To restore an archived flow: 1. Enable "Include items in trash" in the filter 2. Find the flow you want to restore 3. Select "Restore" from the flow card menu The restored flow becomes editable and executable again. However, MCP registration and published status removed during archiving are not automatically restored, so you'll need to reconfigure them if needed. ## Deleting Archived Flows Early You do not have to wait 30 days: "Permanently Delete" in an archived flow's menu deletes that flow, and "Empty Trash" in the banner deletes every flow in the trash. Neither can be undone. ## Important Notes * Archiving unpublishes the flow and removes MCP registration * Scheduled executions are also stopped * **Permanently deleted after 30 days** - restore needed flows before the deadline * Restoration is not possible after permanent deletion # Build a Jinba Flow Workflow with the Chat Panel Source: https://docs.jinba.io/en/pages/basics/chat Describe a workflow to the Jinba Copilot, review its changes, configure tools, and run the flow. ## How It Works The Jinba Copilot uses natural language processing to understand your requirements and automatically generates the appropriate flow structure. Simply describe what you want to accomplish, and the copilot will: * Suggest appropriate tools and configurations * Create the necessary manifest structure * Help you set up API keys and credentials * Guide you through the process step by step ## Step-by-Step Process ### 1. Generate Your Workflow **Jinba Flow uses AI to generate workflows from scratch**. Simply: * Go to the chat input screen on the main page * Enter your requirements in natural language * The AI will automatically start generating your workflow The chat screen also includes several sample templates to help you get started. For example, you can try creating a Gmail draft workflow. ![Chat Interface - Generate Your Workflow](https://mintcdn.com/jinba/B0KuFPdq9oF6s05P/en/pages/basics/images/chat-interface.png?fit=max\&auto=format\&n=B0KuFPdq9oF6s05P\&q=85\&s=8ad627dc437d0c1efeb0da2b5d96c3d1) ### 2. Review and Accept Changes When the workflow generation is complete, you'll see a screen asking you to accept the changes. Click **"Accept Changes"** to proceed. ### 3. Configure Details Once the workflow is generated, you can: * Click on each module to access detailed settings * Modify content, email addresses, or other parameters * Select your Google account (if you set up OAuth in step 1) ### 4. Execute Your Workflow After configuring the details: * Click the **"Run"** button in the top right * The system will automatically process your workflow * Results will appear in the bottom right corner ### 5. View Results Once execution is complete, you can see the actual results. For example, if you created a Gmail draft, you'll find the email saved in your Gmail drafts folder. ## Getting Started 1. Open the chat interface in your Jinba Flow editor 2. Describe your workflow in natural language 3. Follow the copilot's suggestions and prompts 4. Review and refine the generated flow 5. Test and iterate as needed This method is perfect for beginners or when you want to quickly prototype ideas without diving into technical details. # Choose How to Build a Jinba Flow Workflow Source: https://docs.jinba.io/en/pages/basics/choose-flow-editor Compare the chat panel, graph editor, and YAML panel to choose how to build a Jinba Flow workflow. Start with the chat panel if you want to describe a workflow in plain language. Use the graph editor to assemble and inspect steps visually, or edit the YAML manifest when you need direct control over step definitions. You can move between these views while refining the same flow. ![The flow editor. Edit steps visually on the canvas, and ask the AI copilot for changes in the left chat panel](https://mintcdn.com/jinba/B0KuFPdq9oF6s05P/en/pages/basics/images/screens/flow-editor.png?fit=max\&auto=format\&n=B0KuFPdq9oF6s05P\&q=85\&s=024875f6f3661f146070a733fc94183e) The flow editor. Edit steps visually on the canvas, and ask the AI copilot for changes in the left chat panel ## Choose chat for a first draft Use the Jinba Copilot to create flows through natural language conversation. This method is perfect for beginners or when you want to quickly prototype ideas. **Best for:** * Beginners learning Jinba Flow * Quick prototyping * Natural language interaction * Getting started without technical knowledge [Learn more about Chat Panel →](./chat) ## Choose the graph editor to inspect and connect steps Use the visual drag-and-drop graph editor to build flows by connecting pre-built modules. This method provides a visual approach to flow creation. **Best for:** * Building flows with existing tools * Understanding flow structure * Quick assembly of common patterns [Learn more about Graph Editor (Drag & Drop) →](./drag_and_drop) ## Choose YAML to edit the manifest directly Write manifests directly in YAML format for complete control over your flows. This method offers the most flexibility and power. **Best for:** * Advanced users * Custom tool integration * Complex workflows * Complete control over execution [Learn more about YAML Coding Panel →](./manifest) ## Move between the three workflow views * **Start with Chat Panel** if you're new to Jinba Flow or want to quickly explore possibilities * **Use Graph Editor (Drag & Drop)** if you prefer visual interfaces and want to work with existing tools * **Choose YAML Coding Panel** if you need full control and are comfortable with YAML configuration You can start in chat, refine the flow in the graph editor, and edit the YAML manifest when you need direct control. # Install and Use the Jinba Flow CLI Source: https://docs.jinba.io/en/pages/basics/cli Install the Jinba CLI, authenticate, and run Jinba Flow commands from a terminal. `@jinba/cli` provides terminal commands for Jinba Flow. Install it, authenticate, and use the commands below for workspace and flow operations. ## Use the Jinba CLI from a terminal The Jinba CLI (`jinba`) is the official command-line interface for Jinba. It lets you call the Jinba Flow API from your terminal — list workspaces, create and update flows, upload files, and more — without writing HTTP requests by hand. ## Installation ### Requirements * Node.js 20 or later ### Install The CLI is published to npm as a public package. Install it globally: ```bash theme={null} npm install -g @jinba/cli ``` ### Verify the installation ```bash theme={null} jinba --version jinba --help ``` ### Update ```bash theme={null} npm install -g @jinba/cli@latest ``` When a newer version is available, the CLI also prints an update notice in interactive terminal sessions. Older versions may eventually stop being supported; in that case the API asks you to upgrade with the same command. ## Authentication Most API commands require a Jinba user API key. Run any API command and the CLI will prompt for the key if one has not been saved yet: ```bash theme={null} jinba flow api workspace list ``` Get your key from your [profile page](https://flow.jinba.io/profile). The key is stored locally at `~/.config/jinba/config.json`. To remove the saved key: ```bash theme={null} jinba logout ``` You can also configure the CLI via environment variables — useful in CI: | Variable | Purpose | | - | - | | `JINBAFLOW_API_KEY` | API key to use instead of the saved one | | `JINBAFLOW_API_BASE_URL` | Override the API base URL | | `JINBAFLOW_DISABLE_UPDATE_CHECK` | Disable the update notice | ## Usage Commands follow this pattern: ```bash theme={null} jinba flow api [options] ``` Examples: ```bash theme={null} jinba flow api workspace list jinba flow api flow create --workspace-id ws_123 --name "My Flow" --description "Example description" jinba flow api flow create --workspace-id ws_123 --stdin < payload.json jinba flow api workspace archive --workspace-id ws_123 --dry-run jinba flow api file upload --workspace-id ws_123 --file ./report.pdf ``` Every command includes help: ```bash theme={null} jinba flow api flow create --help ``` ## Notes * Path parameters can be passed as positional arguments or as flags such as `--workspace-id`. * `--stdin` reads a JSON object and merges it with explicit flags. * Mutating commands support `--dry-run` and automatically send an `Idempotency-Key`. * Destructive commands (archive, delete, revoke, etc.) prompt for confirmation by default; pass `--yes` or `--force` to skip it. * File upload commands accept a local file path (e.g. `--file ./report.pdf`); the CLI infers the content type from the extension. # Jinba Flow Concepts Source: https://docs.jinba.io/en/pages/basics/core-concepts Essential terminology and concepts for understanding Jinba Flow Understanding these core concepts will help you build effective workflows in Jinba Flow. ## Key Terms | Term | Definition | Example | | - | - | - | | **Flow** | A workflow that connects multiple Steps with dependencies | Email received → AI summarizes → Slack notification. This refers to the entire sequence of processing. | | **Step** | An individual unit of processing that makes up a Flow | Each individual process like receiving email, AI summarization, Slack notification. | | **Tool** | A component that performs a specific action | AI models, API integrations, file processing | | **Secrets** | Securely stored sensitive values | API keys, OAuth tokens | | **Workspace** | A space to organize your Flows, Secrets, and team resources | Project workspace | The diagram below shows how these concepts relate to each other: * A single **Workspace** can be shared by multiple **Accounts**, and one Account can belong to several Workspaces. * Each Workspace contains one or more **Flows**, and every Flow is composed of ordered **Steps**. * Each Step implements its functionality through exactly one **Tool**. * **Secrets** live at the Workspace level, but the same Secret can be reused across multiple Flows and Steps inside that Workspace. * Secrets are how Steps reach **External Services** (APIs, OAuth integrations) without exposing credentials in flow definitions. ![Relationship between Flow, Step, and Tool](https://mintcdn.com/jinba/B0KuFPdq9oF6s05P/en/pages/basics/images/core-concepts/core-concepts-relation.png?fit=max\&auto=format\&n=B0KuFPdq9oF6s05P\&q=85\&s=fe33a02785fddf8ce5edeb370b03331e) ## What's Next? > [card] [Workflow Creation Overview](./choose-flow-editor) > > Learn about the three ways to create workflows > [card] [Chat Panel](./chat) > > Create workflows using natural language # Credit Costs Source: https://docs.jinba.io/en/pages/basics/credit-costs Understand how tools in Jinba Flow are charged to your organization ![The usage page. Track Jinba Credit and Copilot Credit consumption by workflow, tool, and user](https://mintcdn.com/jinba/B0KuFPdq9oF6s05P/en/pages/basics/images/screens/usage.png?fit=max\&auto=format\&n=B0KuFPdq9oF6s05P\&q=85\&s=6086599f845b72dcac67885a9af766ef) The usage page. Track Jinba Credit and Copilot Credit consumption by workflow, tool, and user ## Overview Jinba Flow charges two balances: **Jinba Credits**, which pay for running tools on Jinba's API keys, and **Copilot Credits**, which pay for AI assistance. They are used for different things and reset on different schedules. > Note: Credits and subscription tiers are managed at the **organization** level. > All members of an organization share the same subscription plan and pooled credits. ### At a Glance * Some tools are charged to your organization's balance when they run on Jinba's API keys. * For tools that support it, you can **bring your own API key**. The provider then bills you directly and nothing is charged to your balance. * The app shows your balance, your usage and the price of each step in **US dollars**. * A tool's configuration page shows a badge: a fixed price, or "**Dynamic pricing**" for a tool whose price depends on the run. * The **usage** page shows what each run was actually charged. ## Credit Types ### Jinba Credits **Jinba Credits** pay for executing tools in workflows. They let you use Jinba's API keys without needing your own credentials. Credits are pooled per organization. * **Reset Period**: Monthly (resets on subscription renewal or every 30 days for enterprise users) * **Usage**: Deducted when running workflow tools like AI models, search APIs, and data processing services * **Pricing**: Each tool is priced in one of the ways described in [How Tools Are Priced](#how-tools-are-priced) * **Custom API Key Bypass**: You can provide your own API keys to bypass charges for certain tools * **Monthly usage included**: * Free: \$3 * Standard: \$20 * Professional: \$250 * Enterprise: Custom A Free organization that still shows $2.50 moves to $3 at its next monthly reset. The Standard plan is no longer sold: Professional is the only paid plan you can subscribe to. Organizations already on Standard keep it. ### Copilot Credits **Copilot Credits** pay for AI assistance features and copilot functionality, such as generating step descriptions, summaries, and metadata. Credits are pooled per organization. * **Reset Period**: Daily (resets every day at midnight) * **Usage**: Deducted when using copilot features (1 credit per request) * **Daily Copilot Requests**: * Free: 100 * Standard: 300 * Professional: 500 * Enterprise: Custom > [!NOTE] > > In some organizations, including Free plan organizations, Copilot chat does not use the daily Copilot Credits. Each turn is charged by usage from the organization's Jinba Credit balance instead, and is listed as Copilot in the usage breakdown. A turn needs a set amount of balance to start. A turn that costs more than that amount is still charged in full, so the balance can drop below \$0. The next turn is then refused until the balance is topped up or reset. ## How Tools Are Priced Tools are priced in one of four ways: * **Per token**: for the LLM tools * **From the step's settings**: for image and video generation, and Browser Use Cloud * **From the provider's charge**: for usage-based search * **A fixed price per run**: for everything else Prices can differ between organizations. The usage page shows what your organization was actually charged. ### Per-Token Pricing (LLM Tools) These tools are billed from the tokens a run actually uses: * **OPENAI_INVOKE** / **OPENAI_INVOKE_WITH_FILE** * **ANTHROPIC_INVOKE** / **ANTHROPIC_INVOKE_WITH_FILE** * **GEMINI_INVOKE** / **GEMINI_INVOKE_WITH_FILE** / **GEMINI_INVOKE_WITH_IMAGE** * **GROK_CHAT** * **OPENAI_DEEP_RESEARCH** * **WORD_TEMPLATE_GENERATE** * **TRANSLATE_PPTX_FILE** * **LLAMA_CLOUD_QUERY** * **ANTHROPIC_AGENT** * **BROWSER_USE_SANDBOX_RUN_TASK** **How it works:** 1. **What is counted.** The cost is calculated from the model you select and the tokens the run reports: * input and output tokens * on models that support prompt caching, cached reads and cache writes, each at its own rate * with web search enabled, each search the provider runs 2. **Long-context rates.** Some models bill a whole request at higher rates once its prompt (input plus cached tokens) crosses a long-context threshold, and the cost follows those rates: * the `gpt-5.5` and `gpt-5.6` families above 272K tokens * `gemini-3.1-pro-preview` and `gemini-2.5-pro` above 200K * the Grok models from 200K **ANTHROPIC_AGENT** and **BROWSER_USE_SANDBOX_RUN_TASK** report tokens summed over many requests, so they are always priced at the base rate. 3. **Reservation.** Before the step runs, a **reservation** is held against your balance, so a run cannot start unless you can cover it. When the step finishes, the reservation is replaced by the real cost, which is usually lower. 4. **Runs without usage.** When a run reports no token usage at all, or the model it ran has no published rate, it keeps its reservation. Each tool also has a **minimum charge**, and such a run is never charged less than that. **BROWSER_USE_SANDBOX_RUN_TASK** is the exception: it settles at its minimum, not its reservation. A run that does report tokens on a priced model settles at its actual token cost, with no minimum applied. > [!NOTE] > > Model rates can change, including when a provider's promotional pricing ends. A rate update can change both the balance reserved before a run and the amount charged at completion, even with the same token usage. Charges that have already been settled are not recalculated. Check the usage page for the amount actually charged to your organization. Some tools reserve much more than their minimum, because one run can use a great deal more: | Tool | What the reservation depends on | | - | - | | **OPENAI_DEEP_RESEARCH** | The model: `o3-deep-research` reserves several times what `o4-mini-deep-research` (the default) does | | **BROWSER_USE_SANDBOX_RUN_TASK** | `max_steps` and `llm_model`. Higher `max_steps` reserves more, up to the 100-step maximum | | **WORD_TEMPLATE_GENERATE** | The tool's own 16,000-token output limit | | **GROK_CHAT** | The model: `grok-4.5` reserves more than the default `grok-4.3` | | **TRANSLATE_PPTX_FILE** | Sized for about a 20-slide deck. A larger deck can cost more than the reservation | | **LLAMA_CLOUD_QUERY** | A fixed token estimate for one query | Every other tool in the list above reserves close to its minimum. Steps inside a subflow or loop step are charged too. Before it starts, the enclosing step reserves one pass over its inner steps. It then settles at what the inner steps that actually ran cost, as a single entry on the enclosing step rather than one per inner step. > [!NOTE] > > A run that cannot cover its reservation fails to start with an insufficient-balance error. This happens even when the work itself would have cost far less than the amount held. > > The balance a run can draw on is your organization's balance minus what its other unfinished runs have reserved, so runs started together each need their own headroom. > > Settlement never checks the balance. A run that costs more than it reserved can leave the balance negative, and until it is topped up no new run that reserves credits can start. ### Media Generation Pricing These tools produce no tokens, so they are priced from what they generate. The cost depends only on the step's settings. * **OPENAI_SORA2** is billed per second of video. The rate is set by the model (`sora-2` or `sora-2-pro`) and, for `sora-2-pro`, the output resolution (720x1280 / 1280x720, or 1024x1792 / 1792x1024). * **GEMINI_GENERATE_IMAGE** is billed per image generated, at a rate set by the model (`gemini-3.1-flash-image`, `gemini-nano-banana-2.1`, `gemini-3.1-flash-lite-image`, `gemini-2.5-flash-image` or `gemini-3-pro-image`). New steps default to `gemini-3.1-flash-image`. A Gemini image step keeps running on the model it names until Google shuts that model down, and is charged at that model's rate. Once the model is retired, the step runs on its successor and is charged the successor's rate instead. `gemini-2.5-flash-image`, for example, moves to `gemini-3.1-flash-lite-image` on 2027-03-15. > [!NOTE] > > Sometimes a setting that drives the cost (a model, a duration, a resolution) is filled in by an expression such as `{{ steps.plan.output.model }}`. Its value is not known until the step runs, so the reservation assumes the most expensive option it could resolve to. The final charge is the price of what actually ran. ### Usage-Based Search These tools are charged from what the provider bills for each call (can use your own API key): * **PERPLEXITY_SEARCH** - Tokens at the selected Sonar model's rate plus Perplexity's per-request fee. Sonar Deep Research also bills its searches, citation tokens and reasoning tokens, so it costs much more than `sonar`. A run that reports no usage keeps its reservation. * **EXAAI_SEARCH** - Priced by search type, number of results and contents (text, highlights). More results, deeper search types and more contents cost more. ### Browser Use Cloud * **BROWSER_USE_RUN_TASK** - Priced from `max_steps`: Browser Use's per-task fee plus its per-step fee, so a larger `max_steps` costs more. The step is charged for its full `max_steps` even when the task finishes in fewer steps (can use your own API key). ### Fixed Price Per Run These tools are charged a fixed price each time they run: * **PYTHON_SANDBOX_RUN** - Execute Python code in a secure sandbox (always requires credits) * **SERPAPI_SEARCH** - Search using SerpAPI (can use your own API key) * **FIRECRAWL_SCRAPE** - Scrape web content using Firecrawl (can use your own API key) * **ARXIV_INVOKE_AGENT** - Access research papers from arXiv (always requires credits) * **YOUTUBE_GET_TRANSCRIPT** - Extract transcripts from YouTube videos (always requires credits) * **LLAMA_CLOUD_PARSE** - Parse documents with LlamaCloud (can use your own API key) * **JINBA_FLEX_PARSER** - Flexible document parsing (can use your own API key) * **JINBA_MODULES_PARSE**, **JINBA_MODULES_EXTRACT**, **JINBA_MODULES_CHECKER_V2**, **CHECKER_CHECK_BY_JSON**, **CHECKLIST** - Run on Jinba's model keys ### Knowledge Base Uploads Adding a file to a knowledge base is charged to your Jinba Credits from the tokens the upload uses. Two kinds of tokens are counted: * the embedding tokens of every chunk (`text-embedding-3-large`) * for PDF pages that have no text layer, the Gemini OCR tokens that read them Each file is recorded as one charge. A file cannot be added while the organization has no Jinba Credits left. See [Knowledge](/en/pages/basics/knowledge). ## Copilot Credit Usage Copilot Credits are consumed when using AI assistance features: * **Step Description Generation**: 1 credit per request * **Flow Summary Generation**: 1 credit per request * **Metadata Generation**: 1 credit per request * **Cron Expression Parsing**: 1 credit per request * **Chat/Copilot Conversations**: 1 credit per request, or charged from the Jinba Credit balance (see the note under [Copilot Credits](#copilot-credits)) ## Bring Your Own API Key For tools that support it, you can provide your own API keys to avoid being charged: > [!NOTE] > > When a tool supports "bring your own API key," you can configure your own credentials to bypass charges. Tools marked "always requires credits" are charged regardless of configuration. ### How to Configure Your API Keys 1. Navigate to the **Credentials** section in your workspace settings 2. Select the appropriate service (e.g., Anthropic, OpenAI, Gemini) 3. Enter your API key 4. Save your configuration Once configured, the system uses your API key instead of charging your balance when you use those tools. > [!NOTE] > > A step whose API-key field points at your own secret only ever runs on that key. If the secret it references has been deleted or is empty, the step fails with a `MissingApiKeySecret` error before the tool is called; it does not silently run on Jinba's key. Re-create the secret, or set the field back to Jinba credits. ### Tools That Always Require Credits Some tools always require credits because they use Jinba's infrastructure or specialized services: * **ARXIV_INVOKE_AGENT** - Uses OpenAI API + E2B sandbox * **YOUTUBE_GET_TRANSCRIPT** - Uses Smartproxy residential proxy * **PYTHON_SANDBOX_RUN** - Uses E2B code interpreter sandbox These tools cannot use external API keys and are always charged to your balance. # Debug Failed Jinba Flow Runs Source: https://docs.jinba.io/en/pages/basics/debug Find the first failing step, inspect its inputs and outputs, and test a fix. Start with the run that failed. Find the first step marked as failed, then inspect its inputs, output, and error details before changing the flow. ![Run history with execution status and run details](https://mintcdn.com/jinba/B0KuFPdq9oF6s05P/en/pages/basics/images/screens/run-history.png?fit=max\&auto=format\&n=B0KuFPdq9oF6s05P\&q=85\&s=1083807e0e6bc5f6073cbdff869d5c43) Open a run to inspect its inputs, step outputs, and errors ## Inspect a failed run 1. Open the flow's run history and select the failed run. 2. Find the first failed step. Steps that need it are marked cancelled, not failed, so fix the first failure before looking at them. 3. Review the step's inputs, output, and error message. 4. Compare each input name and value with the selected tool's documentation. 5. Correct the flow and run it again. A step error has a name (such as `StepTimeoutError`), a message, and, when available, a stack trace. ### Step statuses | Status | Meaning | | - | - | | `success` | The step finished | | `failed` | The step raised an error | | `cancelled` | A step in its `needs` failed or was cancelled, so it did not run | | `skipped` | Its `when` condition was false, or every step in its `needs` was skipped | For a `forEach` step, each item has its own status. The step as a whole is `partial` when some items failed and others succeeded. ![The run dialog for entering inputs and testing a flow](https://mintcdn.com/jinba/B0KuFPdq9oF6s05P/en/pages/basics/images/screens/run-modal.png?fit=max\&auto=format\&n=B0KuFPdq9oF6s05P\&q=85\&s=dcc617a8e52309ed204eee9b1f21ecbe) Run a flow with test inputs, then open the result details ## Test one step Use **Run Step** on a step to test that step without running the entire flow. If the flow has unsaved changes, use **Save & Run Step**. * The step reads earlier steps' results from the latest completed full run. If you ran an earlier step on its own after that, its newer result is used. * If the flow has never completed a full run, references to earlier steps resolve to empty values. Run the whole flow once first. * The step runs even if its `when` condition is false or a step in its `needs` failed, and it is not retried. After the step runs, inspect its result in the run details. The shape of `result` depends on the tool; use that tool's documentation to confirm the fields you can reference. ## Troubleshoot common failures ### The flow does not validate * Check that each step has a unique ID and a valid tool ID. * Check that each tool step has an `input` list, even if it is empty. * Compare input and configuration names with the selected tool's documentation. * Check YAML indentation and step references. Common validation messages: | Message | Cause | | - | - | | `Duplicate step IDs found in flow` | Two steps share an `id` | | `Flow contains circular dependencies` | Steps need each other in a loop | | `Tool not found: ` | The `tool` value is not a tool ID | | `Invalid config or input for tool "": ...` | An input or config value is missing or has the wrong type; the rest of the message names the field | | `Invalid step references: ...` | A template refers to a step that does not exist, a field that the tool's output never includes, `item` outside a `forEach` step, or a step result inside `config` | See [Write a YAML manifest](./manifest) for the manifest structure. ### A run is refused because a model was shut down A flow can't start while one of its steps is pinned to a model its provider has shut down. No step runs and no credits are charged. The refusal starts the day after the shutdown date, and it applies even if `when` would skip the step or you run from a later step. | How the run started | What you see | | - | - | | **Run** or **Run Step** in the editor | A dialog lists each step, its model, and the recommended replacement | | Schedule, webhook, Slack, or Twilio | A failed run in the run history, with the reason in its error | | API or MCP | An error that names the steps and models | | `JINBA_FLOW_RUN` in another flow | The step's `result` has `status: failed` and the reason in `error`; the parent flow continues | To fix it, choose another model in each step. If the flow runs from its published version, publish it again. A retired Gemini image model or Grok model is not refused, because those requests still run on the successor. ### A step fails immediately * Read the error shown for that step. * For an integration step, check its credential and the permissions granted to that credential. * Confirm required inputs are present and have the expected type. * If the error comes from an external service, check that service's response and status, including rate limits. * `Step '' timed out after ms` means the step ran longer than its time limit. ### A step is skipped or cancelled * `cancelled`: find the failed step it needs and fix that step first. * `skipped`: check its `when` condition against the actual output of the steps it refers to. With `{{ }}` placeholders, the text is filled in before evaluation, so quote text values: `"'{{ steps.check.result.type }}' == 'premium'"`. * `Failed to evaluate when condition on step ''` means the condition could not be evaluated, often because it refers to a field that the result does not have. The step is marked failed. ### A later step cannot find a value * Confirm the referenced step ID matches the manifest exactly. * Check the prior step's actual output; tools return different result shapes. * Add the prior step ID to `needs`. A reference alone does not make a step wait, and a missing value becomes an empty string instead of an error. * Use the supported reference form, such as `{{ steps.fetch.result }}`. ### A step produces unexpected output * Compare the inputs shown for the step with what you expected; objects and arrays are inserted as JSON text. * Check the tool's configuration and documentation. * Run the step again with **Run Step** after each change. ## Share a useful error report When asking for help, include the flow ID, run ID, failed step ID, the exact error message, and the relevant input/output shape. Remove API keys, tokens, and private data first. # Build a Jinba Flow Workflow with the Graph Editor Source: https://docs.jinba.io/en/pages/basics/drag_and_drop Add and connect tools on the graph canvas, configure each step, and inspect the workflow structure. ![The tool palette. Click "+" to browse tools by function or by service and add them to the canvas](https://mintcdn.com/jinba/B0KuFPdq9oF6s05P/en/pages/basics/images/screens/tool-palette.png?fit=max\&auto=format\&n=B0KuFPdq9oF6s05P\&q=85\&s=5834092c234026f039c6f25a3a7958a5) The tool palette. Click "+" to browse tools by function or by service and add them to the canvas ## How It Works The Graph Editor uses a visual drag-and-drop interface where you can: * Browse available tools and modules * Drag them onto the canvas * Connect them using the connection points * Configure each module through the side panel * Visualize the flow structure in real-time ## Key Features You can use the top and bottom dots to connect tools to each other to form dependencies, and you can click on the three dots to the right of the tool name to delete it. ## Advanced Options You may want to learn to use the manifest editor view in order to make more advanced flows, but advanced options are also available in the `Advanced Options` tab of the side panel. This method is ideal for those who prefer to work with existing tools rather than writing code from scratch. # History and Versions Source: https://docs.jinba.io/en/pages/basics/history-versions Learn about workflow version history and execution history ![The versions panel. Review the history of published versions](https://mintcdn.com/jinba/B0KuFPdq9oF6s05P/en/pages/basics/images/screens/versions.png?fit=max\&auto=format\&n=B0KuFPdq9oF6s05P\&q=85\&s=c14ca1bb29465ecdfeec053f4f673d2c) The versions panel. Review the history of published versions ## Overview Jinba Flow automatically tracks versions of your workflows and maintains a complete execution history. This allows you to view past changes, restore previous versions, and analyze workflow execution patterns. ## Workflow Versions ### What are Versions? Every time you make significant changes to a workflow, Jinba Flow creates a new version: * **Automatic Versioning**: Versions are created automatically when you publish, restore, or accept copilot changes * **Version History**: All versions are preserved, allowing you to see the evolution of your workflow * **Version Labels**: Versions are labeled to indicate their purpose: PUBLISH, RESTORE or COPILOT_CHANGE_ACCEPTION, shown in the versions panel as **Published**, **Restored** and **Copilot** ### Version Types #### Published Version The version that is currently published and accessible via API or MCP: * **Stable Reference**: This version remains unchanged even if you edit the workflow * **API Access**: External systems use this version * **MCP Tools**: AI assistants use this version when invoking the workflow #### Current/Editable Version The version you're currently editing: * **Active Development**: This is your working version * **Unpublished Changes**: May have changes not yet published * **Preview Mode**: You can preview other versions while keeping this as your working version #### Previous Versions All other versions in the workflow's history: * **Historical Record**: Complete history of all workflow changes * **Restoration**: Can be restored to become the current editable version * **Comparison**: Can be compared with current version ## Viewing Version History ### Accessing Versions 1. Open your workflow in the Flow Editor 2. Navigate to the **Versions** panel (usually in the right sidebar) 3. View the list of all workflow versions ### Version Information Each version shows: * **Creation Date**: When the version was created * **Label**: Version type (PUBLISH, RESTORE, COPILOT_CHANGE_ACCEPTION) * **Status**: Whether it's published, current, or previous * **Steps**: The workflow steps at that point in time ### Previewing Versions You can preview any version without making it your current version: 1. Click on a version in the versions list 2. The workflow editor shows that version's steps 3. You can see how the workflow looked at that point 4. Click the current version again to exit preview mode **Note**: Previewing a version doesn't change your current editable version. You can preview and compare without affecting your work. ## Restoring Versions ### When to Restore You might want to restore a previous version if: * **Recent Changes Caused Issues**: Recent edits broke the workflow * **Revert to Stable Version**: Go back to a known working version * **Undo Accidental Changes**: Recover from unintended modifications ### How to Restore 1. Open the **Versions** panel 2. Find the version you want to restore 3. Click the **Restore** button (or similar action) 4. Confirm the restoration 5. The selected version becomes your current editable version **Important Notes**: * Restoring creates a new version with label "RESTORE" * Your current editable version is preserved in history * The restored version becomes your working version * You can restore again if needed ## Version Labels Versions are automatically labeled based on how they were created: ### PUBLISH Created when you publish a workflow: * **Purpose**: Marks the version that was published * **Stability**: This version remains stable for API/MCP access * **Updates**: New publishes create new PUBLISH versions ### RESTORE Created when you restore a previous version: * **Purpose**: Marks a version that was restored from history * **Recovery**: Indicates you went back to a previous state * **History**: Preserves the restoration action in history ### COPILOT_CHANGE_ACCEPTION Created when you accept changes suggested by the Copilot: * **Purpose**: Marks versions created through AI assistance * **Collaboration**: Tracks AI-assisted workflow improvements * **Learning**: Helps identify patterns in AI suggestions ## Execution History ### What is Execution History? Execution history tracks all workflow runs: * **Complete Record**: Every workflow execution is recorded * **Version Tracking**: Each run is linked to the version that was executed * **Performance Data**: Execution times and results are tracked * **Error Logging**: Failed executions include error details ### Viewing Execution History 1. Navigate to your workflow 2. Open the **Runs** or **History** tab 3. View a chronological list of all executions ### Execution Information Each execution shows: * **Execution Date**: When the workflow was run * **Status**: Success, failure, or in progress * **Version**: Which workflow version was executed * **Execution Time**: How long the workflow took * **Inputs**: Arguments passed to the workflow * **Outputs**: Results from the execution * **Errors**: Any errors that occurred (if failed) ### Filtering Execution History You can filter execution history by: * **Status**: Show only successful, failed, or running executions * **Date Range**: Filter by when executions occurred * **Version**: View executions of a specific version * **Source**: Filter by how the workflow was triggered (manual, API, scheduled, etc.) ### Execution History Retention By default, execution history is kept with no time limit. An organization owner or admin can set a retention period in Jinba Auth, under **Organization → Run history retention**: keep forever (the default), 7, 30 or 90 days, or a custom number of days. Once an execution is older than the retention period: * **Deleted**: The inputs and outputs of every step, including large outputs kept in file storage. Deletion is permanent. * **Not deleted**: * The record of the execution itself — when it ran, who ran it, which workflow, whether it succeeded or failed, and how many credits it used. * Files that a workflow read, or saved to the workspace's files. Things to know before setting a period: * The setting applies to every workspace in the organization. * Deletion runs once a day, so data is removed within about a day of passing the retention period. * Shortening the period also deletes the data of existing executions that are already older than the new period. This cannot be undone. * Executions that are still running, including ones waiting for an approval, are not affected until they finish. * When you re-run a workflow from a step, outputs of an execution whose data was deleted cannot be reused, so the earlier steps run again. * If an execution re-used the outputs of an older one (re-run from a step), the older execution's data is kept until every execution re-using it has passed the retention period. There is no upper limit: as long as the workflow keeps being re-run from a step, large outputs of the execution that first produced them can be kept indefinitely. To bound how long data is kept, run the workflow from the start from time to time. ## Using History for Debugging ### Version Comparison Compare different versions to understand changes: 1. Preview a previous version 2. Compare with your current version 3. Identify what changed between versions 4. Understand the impact of modifications ### Execution Analysis Use execution history to: * **Identify Patterns**: Find recurring issues or successes * **Performance Tracking**: See which versions performed better * **Error Analysis**: Review failed executions to identify problems * **Usage Patterns**: Understand how the workflow is being used ### Debugging Workflow 1. **Find Problematic Version**: Identify when issues started 2. **Compare Versions**: See what changed between working and broken versions 3. **Review Executions**: Check execution history for that version 4. **Restore if Needed**: Restore a working version if current version has issues ## Best Practices 1. **Regular Publishing**: Publish stable versions regularly to create checkpoints 2. **Meaningful Changes**: Make significant changes before creating new versions 3. **Version Review**: Periodically review version history to understand evolution 4. **Execution Monitoring**: Regularly check execution history for issues 5. **Restore Strategically**: Use restoration when needed, but understand it creates new versions 6. **Document Changes**: Use workflow descriptions or notepads to document major changes ## Version Management ### Version Lifecycle 1. **Creation**: Version created automatically on significant actions 2. **Development**: Current editable version is where you work 3. **Publishing**: Publishing creates a stable PUBLISH version 4. **History**: All versions are preserved in history 5. **Restoration**: Previous versions can be restored ### Version Limits * **Storage**: All versions are stored indefinitely * **Access**: You can access any version in history * **Performance**: Large version histories may take longer to load ## Related Features * [Publish](/en/pages/basics/publish) - Learn about publishing workflows * [Debug](/en/pages/basics/debug) - Learn about debugging workflows * [Archive Feature](/en/pages/basics/archive) - Learn about archiving workflows # Create and Use a Knowledge Base in Jinba Flow Source: https://docs.jinba.io/en/pages/basics/knowledge Create a knowledge base, add files, search them, and use the results in a RAG workflow. Create a knowledge base in workspace storage, add files, and use vector search to retrieve relevant content for a flow. ![The knowledge base list. Create and manage vector databases for semantic search](https://mintcdn.com/jinba/B0KuFPdq9oF6s05P/en/pages/basics/images/screens/knowledge.png?fit=max\&auto=format\&n=B0KuFPdq9oF6s05P\&q=85\&s=8e163f2fe4fc17c133dd14e3b447e569) The knowledge base list. Create and manage vector databases for semantic search ## Store and search documents in a knowledge base Jinba Flow's Knowledge feature provides powerful vector database capabilities for building RAG (Retrieval-Augmented Generation) systems. You can create knowledge bases, upload documents, perform semantic search, and integrate AI-powered question-answering into your workflows. ## What are Knowledge Bases? Knowledge Bases are vector databases that store documents with automatic chunking and vectorization. They enable semantic search capabilities, allowing you to find information based on meaning rather than exact text matches. ### Key Features * **Document Storage**: Upload PDF, TXT, MD, CSV, DOCX, XLSX and JSON files of up to 100 MB each. A DOCX or XLSX file must be a genuine Office document (password-protected, encrypted or malformed files are rejected); an archive that would expand far beyond its size (more than 10,000 entries, more than 256 MiB in one entry or 1 GiB in total, or — once it expands past 8 MiB — more than 200× its compressed size) is rejected at upload * **Automatic Processing**: Documents are automatically chunked and vectorized * **Semantic Search**: Find relevant information using natural language queries * **RAG Support**: Perfect for building AI-powered question-answering systems * **Vector Embeddings**: Uses OpenAI's text-embedding-3-large for high-quality embeddings ## Creating a Knowledge Base 1. Navigate to **Storage** in the workspace sidebar 2. Click on the **Knowledge Bases** tab 3. Click **Create Knowledge Base** 4. Enter a name and description for your knowledge base 5. The knowledge base is created and ready for file uploads ## Adding Files to Knowledge Base ### Using the UI 1. Open your knowledge base from the Storage page 2. Click **Upload File** or **Add File** 3. Select files from your computer, drop files or whole folders onto the dialog (up to 1,000 files per folder), or provide a URL. Files in an unsupported format or over the size limit are listed and skipped 4. Files are automatically processed: * **Parsing**: Extract text content from documents; PDF pages without a text layer are read with OCR * **Chunking**: Split documents into manageable chunks (configurable) * **Embedding**: Convert chunks to vector embeddings * **Indexing**: Store vectors for fast similarity search > [!NOTE] > > Processing a file consumes Jinba Credits of the workspace's organization, priced from the embedding tokens of its chunks and, for PDF pages read with OCR, the OCR tokens — see [Knowledge Base Uploads](/en/pages/basics/credit-costs#knowledge-base-uploads). While the organization has no Jinba Credits left, a new file is not processed and is marked **failed** with an insufficient-credits message. ### Using Workflows You can also add files to knowledge bases programmatically using the `JINBA_KNOWLEDGE_BASE_FILE_ADD` tool: ```yaml theme={null} - id: add_file_to_kb name: add_file_to_kb tool: JINBA_KNOWLEDGE_BASE_FILE_ADD config: - name: token value: "{{secrets.JINBAFLOW_WS_API_KEY}}" input: - name: knowledgeBaseId value: "{{secrets.KNOWLEDGE_BASE_ID}}" - name: file value: "https://example.com/document.pdf" - name: filename value: "document.pdf" - name: executionMode value: "SYNCHRONOUS" - name: chunkerSettings value: chunkSize: 512 chunkOverlap: 128 chunkingIdentifier: "\\n\\n" ``` **File Processing Status**: * **pending**: File uploaded, waiting for processing * **processing**: File is being chunked and vectorized * **completed**: File is ready for search * **failed**: Processing encountered an error ## Vector Search Vector search enables semantic search across your knowledge base using natural language queries. ### How It Works 1. **Query Vectorization**: Your search query is converted to a vector using OpenAI's text-embedding-3-large 2. **Similarity Search**: The system finds chunks with similar vectors 3. **Ranking**: Results are ranked by similarity score 4. **Filtering**: Results below the threshold are filtered out ### Using Vector Search ```yaml theme={null} - id: search_kb name: search_kb tool: JINBA_VECTOR_SEARCH config: - name: token value: "{{secrets.JINBAFLOW_WS_API_KEY}}" input: - name: query value: "How do I configure authentication?" - name: knowledgeBaseId value: "{{secrets.KNOWLEDGE_BASE_ID}}" - name: topK value: 5 - name: threshold value: 0.3 ``` **Parameters**: | Parameter | Type | Required | Default | Description | | - | - | - | - | - | | `query` | string | Yes | - | Natural language search query | | `knowledgeBaseId` | string | Yes | - | ID of the knowledge base to search | | `topK` | number | No | 3 | Number of results to return (1-50) | | `threshold` | number | No | 0.3 | Similarity threshold (0-1) | ## Building RAG (Retrieval-Augmented Generation) Systems RAG combines retrieval of relevant information from knowledge bases with AI generation to create accurate, context-aware responses. ### What is RAG? RAG (Retrieval-Augmented Generation) is a technique that: 1. **Retrieves** relevant information from a knowledge base using semantic search 2. **Augments** the AI prompt with retrieved context 3. **Generates** responses based on both the query and retrieved context This approach allows AI models to answer questions using your own documents and data, rather than relying solely on their training data. ### Step-by-Step: Building a RAG System #### Step 1: Create a Knowledge Base 1. Go to **Storage** → **Knowledge Bases** 2. Create a new knowledge base (e.g., "Company Documentation") 3. Note the knowledge base ID for later use #### Step 2: Upload Documents 1. Open your knowledge base 2. Upload relevant documents (PDFs, DOCX, text files) 3. Wait for processing to complete (files show "completed" status) #### Step 3: Build the RAG Workflow Create a workflow that combines vector search with AI generation: ```yaml theme={null} - id: user_question name: user_question tool: INPUT_TEXT input: - name: description value: "Enter your question" - id: search_knowledge_base name: search_knowledge_base tool: JINBA_VECTOR_SEARCH needs: [user_question] config: - name: token value: "{{secrets.JINBAFLOW_WS_API_KEY}}" input: - name: query value: "{{steps.user_question.result}}" - name: knowledgeBaseId value: "{{secrets.KNOWLEDGE_BASE_ID}}" - name: topK value: 5 - name: threshold value: 0.3 - id: generate_answer name: generate_answer tool: ANTHROPIC_INVOKE needs: [user_question, search_knowledge_base] config: - name: version value: claude-sonnet-5-5 input: - name: prompt value: | Based on the following information from our knowledge base, answer the user's question. Question: {{steps.user_question.result}} Relevant Information: {%- for r in steps.search_knowledge_base.results %} **Source: {{ r.file.filename }}** (Relevance: {{ r.score }}) {{ r.chunk.content }} --- {%- endfor %} Please provide a comprehensive and accurate answer based on the information above. If the information doesn't contain enough details to answer the question, say so. ``` #### Step 4: Configure Secrets 1. The `token` config of the Jinba tools defaults to `{{ secrets.JINBAFLOW_WS_API_KEY }}`, the workspace API key that Jinba Flow provides to every run, so you can omit it; the examples spell it out 2. Store your **Knowledge Base ID** as a secret under **Secrets** (or use it directly in the workflow) ### Advanced RAG Patterns #### Multi-Step RAG with Refinement ```yaml theme={null} - id: initial_search name: initial_search tool: JINBA_VECTOR_SEARCH config: - name: token value: "{{secrets.JINBAFLOW_WS_API_KEY}}" input: - name: query value: "{{steps.user_question.result}}" - name: knowledgeBaseId value: "{{secrets.KNOWLEDGE_BASE_ID}}" - name: topK value: 10 - id: refine_query name: refine_query tool: ANTHROPIC_INVOKE needs: [initial_search] config: - name: version value: claude-sonnet-5-5 input: - name: prompt value: | Based on the initial search results, generate a more specific search query. Original Query: {{steps.user_question.result}} Initial Results: {%- for r in steps.initial_search.results %} - {{ r.file.filename }}: {{ r.chunk.content }} {%- endfor %} Generate a refined search query that will find more specific information. - id: refined_search name: refined_search tool: JINBA_VECTOR_SEARCH needs: [refine_query] config: - name: token value: "{{secrets.JINBAFLOW_WS_API_KEY}}" input: - name: query value: "{{steps.refine_query.result.content}}" - name: knowledgeBaseId value: "{{secrets.KNOWLEDGE_BASE_ID}}" - name: topK value: 5 - name: threshold value: 0.4 - id: final_answer name: final_answer tool: ANTHROPIC_INVOKE needs: [refined_search] config: - name: version value: claude-sonnet-5-5 input: - name: prompt value: | Answer the user's question using the refined search results. Question: {{steps.user_question.result}} Refined Search Results: {%- for r in steps.refined_search.results %} **{{ r.file.filename }}** (Score: {{ r.score }}) {{ r.chunk.content }} {%- endfor %} Provide a detailed, accurate answer. ``` ## Managing Knowledge Base Files ### Updating Files You can update existing files in a knowledge base using the `JINBA_KNOWLEDGE_BASE_UPDATE` tool: ```yaml theme={null} - id: update_kb_file name: update_kb_file tool: JINBA_KNOWLEDGE_BASE_UPDATE config: - name: token value: "{{secrets.JINBAFLOW_WS_API_KEY}}" input: - name: knowledgeBaseId value: "{{secrets.KNOWLEDGE_BASE_ID}}" - name: knowledgeBaseFileId value: "{{secrets.FILE_ID}}" - name: fileUrl value: "https://example.com/updated-document.pdf" - name: updateType value: "FULL_REFRESH" - name: executionMode value: "SYNCHRONOUS" ``` **Update Types**: * **FULL_REFRESH**: Replaces the entire file with new content * Other update modes may be available depending on your configuration ## Chunking Configuration When adding files to knowledge bases, you can configure how documents are chunked: * **chunkSize**: Size of each chunk in tokens (default: 512, max: 8192) * **chunkOverlap**: Overlap between chunks in tokens (default: 128, max: 2048) * **chunkingIdentifier**: String used to identify chunk boundaries (default: "\n\n") **Best Practices**: * **Smaller chunks (256-512)**: Better for precise information retrieval * **Larger chunks (1024-2048)**: Better for maintaining context * **Overlap**: Helps maintain context across chunk boundaries ## RAG Best Practices 1. **Quality Knowledge Base**: Upload high-quality, relevant documents 2. **Appropriate Chunking**: Use appropriate chunk sizes (typically 512-1024 tokens) 3. **Threshold Tuning**: Adjust similarity thresholds based on your use case 4. **TopK Selection**: Retrieve enough context (typically 3-10 chunks) for comprehensive answers 5. **Prompt Engineering**: Craft prompts that clearly instruct the AI to use retrieved context 6. **Source Attribution**: Always cite sources for transparency and verification 7. **Error Handling**: Handle cases where no relevant information is found ## Use Cases for RAG * **Customer Support**: Answer questions using product documentation * **Internal Knowledge**: Access company policies and procedures * **Research Assistant**: Search through research papers and documents * **Legal Document Q\&A**: Answer questions about contracts and legal documents * **Technical Documentation**: Help developers find information in technical docs * **Product Information**: Answer questions about product specifications ## Related Features * [Workspace](/en/pages/basics/workspace) - Learn about workspace management and file storage * [Vector Search Tool](/en/pages/tools/jinba/vector_search) - Detailed vector search documentation * [Knowledge Base Tool](/en/pages/tools/jinba/knowledge_base) - Knowledge base management tools # Write a Jinba Flow Workflow Manifest in YAML Source: https://docs.jinba.io/en/pages/basics/manifest Define workflow steps, tool inputs, dependencies, conditions, and loops in a Jinba Flow manifest. A flow manifest is a YAML document with a flow name and an ordered list of steps. Each tool step has an ID, a tool ID, and an input list. Use the tool's documentation to confirm its accepted inputs and configuration. ![The code panel. Edit the entire flow directly as a YAML manifest](https://mintcdn.com/jinba/B0KuFPdq9oF6s05P/en/pages/basics/images/screens/manifest-code.png?fit=max\&auto=format\&n=B0KuFPdq9oF6s05P\&q=85\&s=dd42c98f1d3f268c23bfdce859da8ed5) The code panel. Edit the entire flow directly as a YAML manifest ## A runnable example This flow accepts text and returns it in a greeting: ```yaml theme={null} name: First workflow steps: - id: name tool: INPUT_TEXT input: - name: value value: Jinba - id: greeting tool: OUTPUT_TEXT needs: - name input: - name: value value: "Hello, {{ steps.name.result }}!" ``` ## Flow and step fields | Field | Where | Purpose | | - | - | - | | `name` | Flow | Required flow name | | `description` | Flow | Optional description of what the flow does | | `steps` | Flow | Required list of steps | | `id` | Step | Required unique identifier; use letters, numbers, underscores, or hyphens. `__proto__`, `constructor` and `prototype` are reserved | | `name` | Step | Optional display name shown in the editor | | `description` | Step | Optional note explaining what the step does | | `tool` | Tool step | Tool ID from the Jinba Flow tool catalog | | `input` | Tool step | List of `name` and `value` pairs accepted by that tool | | `config` | Tool step | Optional list of tool-specific configuration values | | `needs` | Step | IDs of steps that must finish before this step runs | | `when` | Step | Optional CEL expression; a falsy result skips the step | | `forEach` | Step | Optional expression that supplies an array to process item by item | A tool step must include `input`, even when it has no values to pass. For example, use `input: []` for a tool that takes no inputs. Include only fields supported by the selected tool. ## Configure a tool `config` uses the same `name` and `value` list as `input`. Configuration values can reference secrets but not step results: ```yaml theme={null} config: - name: value: "{{ secrets. }}" ``` ## Set the execution order Steps run in the order set by `needs`, not by their position in the file. Steps with no `needs` start together. * A step waits for every step listed in `needs`. Referencing `steps.` in an input does not make the step wait; list that ID in `needs`. * Branches can split and rejoin. A step can need two steps that both need the same earlier step. * Circular dependencies are rejected with `Flow contains circular dependencies`. * If a step in `needs` fails or is cancelled, the dependent step is cancelled. If every step in `needs` was skipped, the dependent step is skipped too. ## Pass a previous step's result Use the step ID and its `result` to reference an earlier output. The result's shape depends on the tool; check that tool's documentation before selecting a nested field. ```yaml theme={null} - id: greeting tool: OUTPUT_TEXT needs: [name] input: - name: value value: "Hello, {{ steps.name.result }}!" ``` The `needs` list makes the dependency explicit. Step IDs also identify flow inputs: when calling a published flow, use the input step's ID as the argument name. Values available in templates: | Reference | Value | | - | - | | `{{ steps..result }}` | The whole result of an earlier step | | `{{ steps..result. }}` | One field of that result; array elements use `[0]` | | `{{ secrets. }}` | A workspace secret | | `{{ item }}`, `{{ itemIndex }}`, `{{ itemCount }}` | The current element, its zero-based position, and the array length in a `forEach` step | A `{{ steps..result... }}` placeholder that resolves to an object or array is inserted as JSON text. Strings are inserted as-is, and a missing value becomes an empty string. See [Variables & Templates](/en/pages/basics/variables) for more patterns. ## Conditions and loops Use CEL directly for a condition. For example, this expression runs a step when an earlier result has a truthy `isValid` field: ```yaml theme={null} when: "steps.check.result.isValid" ``` A condition can also use `{{ }}` placeholders. They are filled in first, and the resulting text is evaluated as CEL, so quote text values: ```yaml theme={null} when: "'{{ steps.check_genre.result.content }}' == 'General'" when: "{{ steps.count_items.result }} > 5" ``` If the condition cannot be evaluated, for example because it refers to a missing field, the step fails with `Failed to evaluate when condition on step ''`. Use `forEach` to run a step for each item in an array. The current item is available as `item` in supported expressions: ```yaml theme={null} forEach: "{{ steps.get_items.result }}" ``` Later steps read `steps..result` as an array of the successful items' results. See [Step Module Options](/en/pages/basics/step-options) for more `needs`, `when`, and `forEach` examples. ## Templates Input values are rendered as [Nunjucks](https://mozilla.github.io/nunjucks/templating.html) templates before the step runs. Besides `{{ }}` placeholders, you can use loops, conditions, and filters: ```yaml theme={null} - name: prompt value: | Review these items: {%- for entry in steps.get_items.result.items %} - {{ entry.name }} {%- endfor %} {%- if steps.check.result.status == 'urgent' %} Flag anything that needs a reply today. {%- endif %} ``` * `{%-` and `-%}` remove the whitespace before or after a tag. * Inside a loop, `loop.index` is the 1-based position. * Built-in filters include `default('')`, `upper`, `lower`, `trim`, `replace('', '')`, `length`, and `join(', ')`. * `json` outputs strict JSON. A placeholder with a filter is not converted to JSON automatically, so add `| json` when the value is an object. * For a `forEach` result, `successful`, `failed`, `results`, and `pluck('')` filter or extract per-item outputs. Python's `zip()` and inline loop filters such as `for x in items if ...` are not supported; use an `{% if %}` block inside the loop instead. ## Multi-line values Use `|` in YAML for a value that spans several lines, such as code or a prompt. The value continues until the indentation ends. `|-` does the same but drops the final line break. ## Example: split and combine This flow reads a list of numbers, sums the even and odd numbers in parallel, and combines the results: ```yaml theme={null} name: Sum numbers steps: - id: input_data tool: INPUT_JSON input: - name: value value: '{"numbers": [1, 2, 3, 4, 5]}' - id: sum_even tool: PYTHON_SANDBOX_RUN needs: [input_data] input: - name: code value: | data = {{ steps.input_data.result }} sum(x for x in data["numbers"] if x % 2 == 0) - name: data_type value: NUMBER - id: sum_odd tool: PYTHON_SANDBOX_RUN needs: [input_data] input: - name: code value: | data = {{ steps.input_data.result }} sum(x for x in data["numbers"] if x % 2 != 0) - name: data_type value: NUMBER - id: combine tool: PYTHON_SANDBOX_RUN needs: [sum_even, sum_odd] input: - name: code value: "{{ steps.sum_even.result.data }} * 2 + {{ steps.sum_odd.result.data }}" - name: data_type value: NUMBER ``` * `input_data` returns the parsed JSON object. * `sum_even` and `sum_odd` both need only `input_data`, so they run at the same time. The last line of the code is the result, available as `result.data` (6 and 9). * `combine` waits for both branches and returns 21. ## Validate a manifest If a flow does not validate or run: * Check that each step ID is unique and contains only letters, numbers, underscores, or hyphens. * Check that each tool ID and input name exists in that tool's documentation. * Check that every referenced step ID exists and is listed under `needs`. * Check that result references use the output shape documented for that tool. * Check that YAML indentation is consistent. See [the tool catalog](/en/pages/tools/index) for tool IDs and inputs, and [Debug](/en/pages/basics/debug) for validation error messages. # Publish a Jinba Flow as an MCP Server Source: https://docs.jinba.io/en/pages/basics/mcp Expose published Jinba Flow workflows as tools and connect an MCP client to your workspace. A Jinba Flow workspace can expose selected published flows as tools through a Streamable HTTP MCP server. Configure the flows in the workspace's **MCP** settings, then connect an MCP client using the endpoint and workspace API key shown there. ![Workspace MCP settings for configuring flows as MCP tools](https://mintcdn.com/jinba/B0KuFPdq9oF6s05P/en/pages/basics/images/screens/mcp.png?fit=max\&auto=format\&n=B0KuFPdq9oF6s05P\&q=85\&s=8cbcd55873e417f7296c5eb9addaf109) Workspace MCP settings show the flows configured as tools and the client connection details ## Prepare a flow Publish the flow you want to make available. Add an `INPUT_*` step for each value the client should provide. An input step's ID becomes the parameter name, so use a clear ID and description. For example, this flow accepts a name and returns a greeting: ```yaml theme={null} name: Greeting steps: - id: name tool: INPUT_TEXT input: - name: value value: Jinba - id: greeting tool: OUTPUT_TEXT needs: [name] input: - name: value value: "Hello, {{ steps.name.result }}!" ``` In workspace **MCP** settings, select the published flow and add a description that helps the client decide when to use it. The configured flow is exposed as an MCP tool. ## Tool annotations The configuration dialog of each MCP tool also has two annotations that are sent to the AI client together with the tool: * **Read-only Tool** — mark a flow that only checks or reads state and has no side effects such as creating, modifying or sending. Clients treat such a tool as safe to re-run; for example, Jinba App Neo's `wait_for_flow` only accepts tools marked read-only. * **Destructive Action Warning** — mark a flow that deletes, modifies or makes irreversible changes. Clients prompt the user to confirm before running it. A read-only tool is never destructive, so this option is unavailable while read-only is on. ## Connect an MCP client Copy the client configuration from the workspace's **MCP** settings. It contains the current endpoint and connection method. A Streamable HTTP client configuration has this shape: ```json theme={null} { "mcpServers": { "jinbaflow": { "command": "npx", "args": [ "-y", "supergateway", "--streamableHttp", "https://api.jinba.io/api/v2/workspaces/WORKSPACE_ID/mcp", "--header", "Authorization: Bearer YOUR_TOKEN" ] } } } ``` Replace `YOUR_TOKEN` with a workspace API key or a personal API key (`sk-user-…`) created in your profile settings. Personal key owners must be members of the target workspace and have permission to run flows. Frozen and archived workspaces cannot be accessed with personal keys. With a personal key, runs are attributed to the key owner, and flows use that owner's personal secrets. Credits are charged to the organization that owns the flow's workspace. A personal key can access multiple workspaces, so do not share it with others. Revoking the key or leaving the workspace blocks subsequent requests. If the client cancels a request while a tool is still running, the flow run behind it is cancelled as well and shows as cancelled in the run history. The workspace API key grants access to that workspace's MCP server. Keep it private; do not commit it or paste it into a public prompt. ## Verify the connection 1. Connect the client with the configuration from Jinba Flow. 2. Refresh or list the available tools in the client. 3. Confirm the configured flow appears, then call it with a safe test input. If the client connects but shows no tools, check that the flow is published and selected in workspace MCP settings. If authentication fails, copy the current workspace API key and endpoint from those settings. Choose a test flow whose actions are safe to run; an MCP call executes the flow. ## Request limits The MCP endpoint rejects requests that exceed these limits: * A request body larger than 4 MiB is rejected with HTTP 413. This includes the tool arguments of a `tools/call`. * A JSON-RPC batch with more than 32 messages is rejected with HTTP 400. * An `Mcp-Session-Id` that Jinba Flow did not issue is answered with HTTP 404, so the client starts a new session. Standard MCP clients reuse the session ID the server returns from `initialize` and are not affected. # Publish a Jinba Flow for API or MCP Access Source: https://docs.jinba.io/en/pages/basics/publish Publish a workflow, understand its published version, and access it through API or MCP. Publish a tested workflow to make a stable version available for external API calls or MCP use. Follow the steps below to publish, inspect, or unpublish it. ![The publish menu. Publish the current version, configure triggers, or expose the flow as an MCP tool](https://mintcdn.com/jinba/B0KuFPdq9oF6s05P/en/pages/basics/images/screens/publish-modal.png?fit=max\&auto=format\&n=B0KuFPdq9oF6s05P\&q=85\&s=f60a2f9701f0a1293c3f99e63d544360) The publish menu. Publish the current version, configure triggers, or expose the flow as an MCP tool ## What publishing makes available Publishing a workflow in Jinba Flow makes it available for execution via API calls or as an MCP (Model Context Protocol) tool. When you publish a workflow, you create a stable version that can be accessed by external systems, other workflows, or AI assistants. ## What is Publishing? Publishing a workflow: * **Creates a Version**: Saves the current workflow state as a published version * **Generates API Access**: Creates an API key that allows external access to your workflow * **Enables API Execution**: Makes the workflow callable via REST API endpoints * **Enables MCP Integration**: Allows the workflow to be used as an MCP tool for AI assistants * **Locks the Version**: The published version remains stable even if you make changes to the workflow ## Publishing a Workflow ### Step 1: Prepare Your Workflow Before publishing, ensure your workflow is: 1. **Valid**: All steps are properly configured 2. **Tested**: Run the workflow to verify it works correctly 3. **Complete**: All required inputs and outputs are defined ### Step 2: Publish from the Flow Editor 1. Open your workflow in the Flow Editor 2. Review your workflow to ensure it's ready 3. Click the **Publish** button in the editor toolbar 4. If validation passes, the workflow will be published **Note**: The publish button may show different states: * **Publish**: Workflow is not published * **Republish**: Workflow is published but has unpublished changes * **Published**: Workflow is published and up to date ### Step 3: Publishing Options When publishing, you can choose how your workflow is made available: #### Publish as API Publishing as API makes your workflow accessible via REST API: * **API Endpoint**: Your workflow can be called using HTTP requests * **API Key**: An API key is automatically generated for authentication * **Use Cases**: Integration with external systems, webhooks, scheduled tasks #### Publish as MCP Tool Publishing as MCP makes your workflow available as a tool for AI assistants: * **MCP Integration**: The workflow appears as a tool in MCP-compatible AI assistants * **Parameter Configuration**: Define input parameters that AI assistants can use * **Use Cases**: AI-powered automation, assistant workflows, conversational interfaces **Note**: You can publish a workflow as both API and MCP simultaneously. ## Publishing Process ### Direct Publishing For most workspaces, publishing is immediate: 1. Click **Publish** in the flow editor 2. The workflow is validated 3. A new version is created and marked as published 4. An API key is generated (if not already exists) 5. The workflow becomes available via API/MCP ### Approval Process (Enterprise) For Enterprise workspaces with approval processes enabled: 1. Click **Publish** in the flow editor 2. Enter an optional comment explaining the changes 3. Submit an approval request 4. The workflow version is created but not immediately published 5. An approver reviews and approves the request 6. Once approved, the workflow is automatically published **Approval Workflow**: * Approval requests appear in the approver's dashboard * Approvers can review changes and comments * Approvers can approve or reject the request * Approved workflows are automatically published ## Unpublishing a Workflow You can unpublish a workflow to make it unavailable: 1. Open the published workflow in the Flow Editor 2. Click the **Publish** toggle to turn it off 3. Confirm the unpublish action 4. The workflow is no longer accessible via API or MCP **Important Notes**: * Unpublishing does not delete the workflow or its versions * You can republish at any time * If the workflow is published as MCP, unpublishing will remove it from MCP tools * API keys remain but the workflow won't be accessible ## Published Versions ### Version Management When you publish a workflow: * **Version Created**: A new flow version is created with label "PUBLISH" * **Version History**: All published versions are saved in version history * **Stable Reference**: The published version remains unchanged even if you edit the workflow * **Version Comparison**: You can compare different versions to see changes ### Republishing When you make changes to a published workflow: 1. The workflow shows "unpublished changes" indicator 2. Click **Republish** to publish the new version 3. The new version replaces the previous published version 4. The old version remains in history for reference ## Using Published Workflows ### Via API Once published, you can call your workflow via API: ```bash theme={null} curl -X POST https://api.jinba.io/api/v2/external/flows/FLOW_ID/published-run \ -H "Authorization: Bearer YOUR_FLOW_SECRET" \ -H "Content-Type: application/json" \ -d '{ "args": [ {"name": "input1", "value": "example"} ] }' ``` Copy the endpoint and secret key from the flow's **Triggers** panel. See [API](/en/pages/basics/api) for the request and response format. ### Via MCP Published workflows appear as tools in MCP-compatible AI assistants: * **Tool Name**: Based on your workflow name * **Parameters**: Defined input parameters from your workflow * **Description**: Uses your workflow description * **Usage**: AI assistants can invoke your workflow as a tool ### Via JINBA_FLOW_RUN Tool You can also call published workflows from other workflows using the `JINBA_FLOW_RUN` tool: ```yaml theme={null} - id: call_published_flow name: call_published_flow tool: JINBA_FLOW_RUN input: - name: id value: PUBLISHED_FLOW_ID - name: args value: - name: input1 value: "example value" ``` `JINBA_FLOW_RUN` has no configuration: it authenticates with the workspace API key that Jinba Flow provides to the run. `id` is the ID of a published flow in the same workspace, and `args` lists the values for its input steps. ## API Keys ### Automatic Generation When you publish a workflow: * An API key is automatically generated * The key is scoped to the specific workflow * The key is stored securely in your workspace * You can view the key in workflow settings ### Managing API Keys 1. Go to your workflow settings 2. Navigate to the **API** or **Publish Settings** section 3. View or regenerate your API key 4. Use the key in API requests for authentication **Security Best Practices**: * Never share API keys publicly * Rotate keys regularly * Use different keys for different environments * Revoke keys if compromised ## Publishing Best Practices 1. **Test Before Publishing**: Always test your workflow thoroughly before publishing 2. **Version Control**: Use meaningful version labels and comments 3. **Documentation**: Document your workflow's inputs, outputs, and behavior 4. **Error Handling**: Implement proper error handling in your workflows 5. **Security**: Review permissions and access controls before publishing 6. **Monitoring**: Monitor published workflow usage and performance 7. **Gradual Rollout**: Test with a small audience before full deployment ## Publishing Status Indicators The flow editor shows different states: * **Unpublished**: Workflow is not published (gray indicator) * **Published**: Workflow is published and up to date (green indicator) * **Unpublished Changes**: Workflow has changes not yet published (yellow indicator) * **Publishing**: Workflow is currently being published (loading indicator) ## Troubleshooting ### Cannot Publish * **Validation Errors**: Fix any validation errors in your workflow * **Missing Permissions**: Ensure you have publish permissions * **Approval Required**: Submit an approval request if required ### Published Workflow Not Accessible * **Check API Key**: Verify the API key is correct * **Check Permissions**: Ensure the API key has proper permissions * **Verify Endpoint**: Confirm you're using the correct API endpoint * **Check Status**: Verify the workflow is actually published ### MCP Tool Not Appearing * **Publish Required**: The workflow must be published to appear as MCP tool * **MCP Configuration**: Ensure MCP is properly configured in workspace settings * **Parameter Definition**: Define input parameters for MCP tool usage ## Related Features * [Workspace](/en/pages/basics/workspace) - Learn about workspace management * [MCP](/en/pages/basics/mcp) - Learn about Model Context Protocol integration * [Archive Feature](/en/pages/basics/archive) - Learn about archiving workflows # Build and Run Your First Jinba Flow Workflow Source: https://docs.jinba.io/en/pages/basics/quickstart Create and run a text workflow with Jinba Flow using built-in input and output tools. Build a flow that accepts a name and returns a greeting. This first run uses Jinba Flow's built-in text tools, so it needs no external service or credentials. To describe a flow in plain language instead of writing YAML, use the Copilot in the chat panel. See [Build a workflow with the chat panel](./chat). ## Before you start * A Jinba Flow account at [flow.jinba.io](https://flow.jinba.io/) ## Create the workflow 1. Sign in to Jinba Flow and open a new flow. 2. Open the YAML code panel and enter this manifest: ```yaml theme={null} name: First workflow steps: - id: name tool: INPUT_TEXT input: - name: value value: Jinba - id: greeting tool: OUTPUT_TEXT needs: - name input: - name: value value: "Hello, {{ steps.name.result }}!" ``` The `INPUT_TEXT` step provides the flow input. The `OUTPUT_TEXT` step returns a greeting that uses the first step's result. ## Run and check the result Run the flow. If Jinba Flow asks for an input value, enter `Jinba`. A successful run has status `success`; the `greeting` step result is `Hello, Jinba!`. If the run fails, open its details and check the first failed step. `INPUT_TEXT` needs a non-empty `value`. If the output does not include the name, confirm the reference uses the input step's exact ID: `steps.name.result`. ## Next steps > [card] [Write a YAML manifest](./manifest) > > Learn how to define steps, inputs, and dependencies > [card] [Call a flow with the API](./api) > > Run a published flow from another application > [card] [Publish a flow as an MCP tool](./mcp) > > Connect a published flow to an MCP client > [card] [Debug a failed run](./debug) > > Inspect a run and find the first failing step # Schedule a Jinba Flow Workflow Source: https://docs.jinba.io/en/pages/basics/scheduling Set up a recurring flow run with a cron expression and timezone, then manage its schedule. Publish the workflow, then set a cron expression and timezone for recurring runs. Scheduled executions use the published version. ![Schedule settings in the triggers panel. Run flows automatically at a set interval](https://mintcdn.com/jinba/B0KuFPdq9oF6s05P/en/pages/basics/images/screens/triggers.png?fit=max\&auto=format\&n=B0KuFPdq9oF6s05P\&q=85\&s=789de4c3fe2c17e5753fbff76d7e02ff) Schedule settings in the triggers panel. Run flows automatically at a set interval ## Run the published version on a schedule Jinba Flow allows you to schedule workflows to run automatically at specified times using cron expressions. Scheduled workflows execute the published version, making them perfect for automated tasks, periodic data processing, and scheduled reports. ## What is Scheduling? Scheduling enables automatic execution of workflows: * **Automatic Execution**: Workflows run automatically based on a schedule * **Cron Expressions**: Use standard cron syntax to define execution times * **Published Version**: Scheduled workflows always use the published version * **Timezone Support**: Specify timezones for accurate scheduling ## Prerequisites To schedule a workflow: 1. **Published Workflow**: The workflow must be published (see [Publish](/en/pages/basics/publish)) 2. **Schedule Permission**: You need permission to schedule workflows in the workspace 3. **Cron Expression**: Define when the workflow should run ## Setting Up Scheduling ### Step 1: Open Workflow Settings 1. Open your published workflow in the Flow Editor 2. Open the **Triggers** panel 3. Find the **Schedule** section ### Step 2: Enable Scheduling 1. Turn on the **Schedule** switch (it is disabled with the message "Flow must be published to enable scheduling" until the flow is published) 2. The schedule is created preset to every day at midnight in your browser's timezone (`CRON_TZ= 0 0 * * *`); click the schedule to open the form and change it ### Step 3: Configure Schedule 1. Enter a cron expression, fill in the minute/hour/day fields, or describe the schedule in plain language and click **Parse natural language** 2. Select a timezone 3. Review the schedule description and the next run time 4. Click **Save Schedule** ### Step 4: Verify Schedule 1. Check that the schedule is active 2. View the next scheduled execution time 3. Monitor scheduled executions in the execution history ## Cron Expressions ### Basic Cron Syntax Cron expressions consist of five fields: ``` ┌───────────── minute (0 - 59) │ ┌───────────── hour (0 - 23) │ │ ┌───────────── day of month (1 - 31) │ │ │ ┌───────────── month (1 - 12) │ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday) │ │ │ │ │ * * * * * ``` ### Common Cron Examples #### Every Minute ``` * * * * * ``` #### Every Hour ``` 0 * * * * ``` #### Daily at Midnight ``` 0 0 * * * ``` #### Daily at Noon ``` 0 12 * * * ``` #### Every Monday at 9 AM ``` 0 9 * * 1 ``` #### First Day of Every Month at Midnight ``` 0 0 1 * * ``` #### Every 15 Minutes ``` */15 * * * * ``` #### Every Day at 2:30 AM ``` 30 2 * * * ``` #### Weekdays at 9 AM ``` 0 9 * * 1-5 ``` #### First Day of Every Quarter at Midnight ``` 0 0 1 */3 * ``` ## Timezone Support ### Specifying Timezone You can specify a timezone using the `CRON_TZ` prefix: ``` CRON_TZ=America/New_York 0 9 * * * ``` This runs the workflow at 9 AM Eastern Time every day. ### Common Timezones * `UTC`: Coordinated Universal Time * `America/New_York`: Eastern Time * `America/Chicago`: Central Time * `America/Los_Angeles`: Pacific Time * `Europe/London`: Greenwich Mean Time * `Asia/Tokyo`: Japan Standard Time * `Australia/Sydney`: Australian Eastern Time **Note**: Schedules saved from the schedule form always carry a `CRON_TZ` prefix. A cron expression without one is evaluated in the API server's timezone, which can differ from the timezone the form displays, so keep the prefix. ## Schedule Management ### Enabling a Schedule 1. Open the **Triggers** panel 2. Navigate to the Schedule section 3. Turn on the **Schedule** switch 4. Configure the cron expression 5. Click **Save Schedule** ### Disabling a Schedule 1. Open the **Triggers** panel 2. Navigate to the Schedule section 3. Turn off the **Schedule** switch, or click **Disable Schedule** in the schedule form 4. The schedule is immediately disabled **Note**: Disabling a schedule stops all future executions but doesn't affect currently running workflows. ### Updating a Schedule 1. Open the **Triggers** panel 2. Navigate to the Schedule section and click the schedule 3. Modify the cron expression 4. Click **Save Schedule** **Important**: Schedule updates take effect immediately. The next execution uses the new schedule. ## Scheduled Execution Behavior ### Published Version Scheduled workflows always execute the **published version**: * **Stability**: Uses the stable published version, not your current edits * **Consistency**: Ensures scheduled executions use the same version * **Updates**: Republish to update the scheduled workflow version ### Execution Context Scheduled executions: * **Source**: Marked as "SCHEDULE" in execution history * **Arguments**: Use default or empty arguments (unless configured) * **Permissions**: Run with workspace permissions * **Logging**: All executions are logged in execution history ### Execution Monitoring Monitor scheduled executions: 1. View execution history 2. Filter by source "SCHEDULE" 3. Check execution status and results 4. Review any errors that occurred ## Best Practices 1. **Test Before Scheduling**: Test your workflow thoroughly before scheduling 2. **Publish Stable Versions**: Only schedule workflows with stable published versions 3. **Timezone Awareness**: Always specify timezones for accurate scheduling 4. **Monitor Executions**: Regularly check execution history for scheduled runs 5. **Error Handling**: Implement error handling in workflows for scheduled execution 6. **Resource Management**: Consider resource usage for frequently scheduled workflows 7. **Documentation**: Document schedule purpose and timing in workflow description ## Common Use Cases ### Daily Reports Schedule workflows to generate daily reports: ``` # Every day at 8 AM 0 8 * * * ``` ### Data Synchronization Schedule periodic data synchronization: ``` # Every 6 hours 0 */6 * * * ``` ### Weekly Summaries Schedule weekly summary generation: ``` # Every Monday at 9 AM 0 9 * * 1 ``` ### Monthly Processing Schedule monthly data processing: ``` # First day of every month at midnight 0 0 1 * * ``` ### Frequent Monitoring Schedule frequent monitoring tasks: ``` # Every 5 minutes */5 * * * * ``` ## Troubleshooting ### Schedule Not Running **Possible Causes**: * Schedule is disabled * Workflow is not published * Cron expression is invalid * Workflow is archived **Solutions**: 1. Verify schedule is enabled 2. Ensure workflow is published 3. Validate cron expression syntax 4. Check workflow is not archived ### Wrong Execution Time **Possible Causes**: * Timezone not specified * Incorrect cron expression * Timezone conversion issues **Solutions**: 1. Specify timezone explicitly 2. Verify cron expression 3. Test with a simple schedule first ### Execution Failures **Possible Causes**: * Workflow errors * Missing credentials * Resource limitations **Solutions**: 1. Check execution history for errors 2. Verify credentials are configured 3. Review workflow logic 4. Check resource availability ## Schedule Validation ### Cron Expression Validation The system validates cron expressions: * **Syntax Check**: Ensures valid cron syntax * **Range Validation**: Validates field ranges * **Error Messages**: Provides clear error messages for invalid expressions ### Visual Schedule Builder Many interfaces provide visual schedule builders: * **Point-and-Click**: Select schedule options visually * **Preview**: See schedule description before saving * **Validation**: Automatic validation of schedule settings ## Related Features * [Publish](/en/pages/basics/publish) - Learn about publishing workflows * [API](/en/pages/basics/api) - Learn about calling workflows via API * [History and Versions](/en/pages/basics/history-versions) - Learn about execution history # Step Module Options Source: https://docs.jinba.io/en/pages/basics/step-options Learn how to use advanced step options like loops (forEach), conditions (when), and dependencies (needs) in your workflows ![The step settings screen. Switch between form/YAML, configure run conditions, loops, and error handling, and inspect input/output data](https://mintcdn.com/jinba/B0KuFPdq9oF6s05P/en/pages/basics/images/screens/step-options.png?fit=max\&auto=format\&n=B0KuFPdq9oF6s05P\&q=85\&s=1ebcfa2fcbfd491789ef62a4f5dec5bf) The step settings screen. Switch between form/YAML, configure run conditions, loops, and error handling, and inspect input/output data ## Overview Each step in a Jinba Flow can be configured with advanced options that control how and when it executes. These options allow you to create sophisticated workflows with conditional logic, loops, and complex dependencies. ## Step Dependencies (needs) The `needs` option specifies which steps must complete before the current step can run. This creates an execution order and ensures data is available when needed. ### Basic Usage `fetch_data` and `validate_input` stand for earlier steps in your flow; `fetch_data`'s result is assumed to be a list. ```yaml theme={null} - id: analyze_data tool: PYTHON_SANDBOX_RUN needs: - fetch_data - validate_input input: - name: code value: | import json data = json.loads(r'''{{steps.fetch_data.result}}''') len(data) - name: data_type value: NUMBER ``` ### Key Points * **Execution Order**: Order comes only from `needs`. Referencing `{{steps.X...}}` does not make a step wait for `X`, so list every step whose output you read * **Parallel Execution**: Steps that don't depend on each other can run in parallel * **Failure Handling**: If a needed step fails or is cancelled, this step is **cancelled**, and so are the steps that depend on it. If every needed step was skipped, this step is skipped; a skipped step alongside one that succeeded does not stop it. A step with `when` ignores these rules and follows its condition (see below) * **forEach Dependencies**: A forEach step counts as succeeded if at least one item succeeded or it had no items, and as failed if no item succeeded and at least one failed or was cancelled * **Diamond Patterns**: Complex dependency graphs are supported (A→B, A→C, B→D, C→D) ### Example: Multi-Branch Workflow ```yaml theme={null} - id: input_data tool: INPUT_JSON input: - name: value value: "[1, 2, 3, 4, 5]" - id: process_even tool: PYTHON_SANDBOX_RUN needs: - input_data input: - name: code value: | import json data = json.loads(r'''{{steps.input_data.result}}''') json.dumps([x for x in data if x % 2 == 0]) - name: data_type value: OBJECT - id: process_odd tool: PYTHON_SANDBOX_RUN needs: - input_data input: - name: code value: | import json data = json.loads(r'''{{steps.input_data.result}}''') json.dumps([x for x in data if x % 2 != 0]) - name: data_type value: OBJECT - id: combine_results tool: PYTHON_SANDBOX_RUN needs: - process_even - process_odd input: - name: code value: | import json even = json.loads(r'''{{steps.process_even.result.data}}''') odd = json.loads(r'''{{steps.process_odd.result.data}}''') json.dumps({"even": even, "odd": odd}) - name: data_type value: OBJECT ``` `PYTHON_SANDBOX_RUN` uses the value of the last line as its result and stores it under `result.data`. With `data_type: OBJECT`, a final `json.dumps(...)` is returned as structured data. Reading a result through `json.loads(r'''...''')` avoids the breakage you get from pasting JSON (`null`, `true`, `false`) straight into Python. ## Conditional Execution (when) The `when` option allows a step to execute only if a specified condition is true. This enables dynamic workflow behavior based on previous step results. ### Basic Syntax ```yaml theme={null} - id: conditional_step tool: TOOL_NAME when: "" input: - name: param value: "value" ``` ### Condition Expressions Conditions are [CEL](https://cel.dev/) expressions, written directly without `{{ }}`: * **String Comparison**: `steps.check.result.status == 'success'` * **Numeric Comparison**: `steps.count.result.total > 5` * **Boolean Evaluation**: `steps.validate.result.isValid` * **Step Status**: `steps.fetch_data.status == 'failed'` * **Combining**: `&&`, `||`, `!` The template form also works: `{{ }}` placeholders are filled in first, then the text is evaluated as CEL. Put quotes around placeholders that produce strings, for example `"'{{steps.check.result.status}}' == 'success'"`. ### Example: Conditional Branching ```yaml theme={null} - id: check_type tool: PYTHON_SANDBOX_RUN input: - name: code value: | import json json.dumps({"type": "premium"}) - name: data_type value: OBJECT - id: premium_processing tool: PYTHON_SANDBOX_RUN when: "steps.check_type.result.data.type == 'premium'" needs: - check_type input: - name: code value: | "Processing premium user..." - id: standard_processing tool: PYTHON_SANDBOX_RUN when: "steps.check_type.result.data.type == 'standard'" needs: - check_type input: - name: code value: | "Processing standard user..." ``` ### Important Notes * Conditions are evaluated **before** step execution. `item`, `itemIndex` and `itemCount` are not available in `when` * If the condition is false, the step status becomes `skipped` * A step whose needed steps were all skipped is skipped too; if another needed step succeeded, it still runs * When `when` is set, the condition alone decides whether the step runs, and a failed needed step does not cancel it. `when: "true"` runs a step even after a needed step failed; `when: "steps.X.status == 'failed'"` runs it only in that case * If the condition cannot be evaluated (for example, a placeholder renders as empty text), the step is marked `failed` ## Loop Execution (forEach) The `forEach` option executes a step multiple times, once for each item in a collection. This is useful for batch processing lists of data. ### Basic Syntax ```yaml theme={null} - id: get_list tool: INPUT_JSON input: - name: value value: '["apple", "banana", "cherry"]' - id: process_items tool: TOOL_NAME needs: - get_list forEach: "steps.get_list.result" input: - name: value value: "{{item}}" ``` `forEach` also accepts the template form, `"{{steps.get_list.result}}"`. ### How It Works 1. The `forEach` value is evaluated to get a list. If it is not a list, the step runs zero times, without an error 2. The step executes once for each item in the list 3. In the step's inputs, `{{item}}` is the current item, `{{itemIndex}}` its position (from 0), and `{{itemCount}}` the number of items. For an object item use `{{item.}}` or `{{item | json}}`; `{{item}}` alone renders as `[object Object]` 4. Later steps see `steps.` as a list with one entry (`status`, `result`, `error`) per item. `steps..result` is the list of results from the items that succeeded, and `steps..status` is `success`, `partial` or `failed` ### Example: Processing Multiple Items ```yaml theme={null} - id: get_users tool: INPUT_JSON input: - name: value value: | [ {"id": 1, "name": "Alice"}, {"id": 2, "name": "Bob"}, {"id": 3, "name": "Charlie"} ] - id: greet_users tool: PYTHON_SANDBOX_RUN forEach: "steps.get_users.result" needs: - get_users input: - name: code value: | f"Hello, {item['name']}!" - id: combine_greetings tool: PYTHON_SANDBOX_RUN needs: - greet_users input: - name: code value: | import json greetings = json.loads(r'''{{steps.greet_users.result}}''') "\n".join(g["data"] for g in greetings) ``` Inside `PYTHON_SANDBOX_RUN`, the current item is also available as the Python variable `item`. Each greeting is stored as `{"data": "Hello, Alice!"}`, which is why `combine_greetings` reads `g["data"]`. ### Accessing Item Properties ```yaml theme={null} forEach: "steps.items.result" input: - name: id value: "{{item.id}}" - name: name value: "{{item.name}}" ``` ### forEach with Index Use `itemIndex` (from 0) and `itemCount` to know where you are in the loop: ```yaml theme={null} - id: get_items tool: INPUT_JSON input: - name: value value: '["apple", "banana", "cherry"]' - id: process_with_index tool: PYTHON_SANDBOX_RUN needs: - get_items forEach: "steps.get_items.result" input: - name: code value: | position = {{itemIndex}} + 1 total = {{itemCount}} f"{position}/{total}: {item}" ``` ### forEach Options `forEachOptions` controls how the items are processed. In the step settings these are the **Sequential** / **Parallel** choice (with a thread count), the maximum number of items, and the **Stop on error** / **Continue** choice: ```yaml theme={null} - id: process_items tool: TOOL_NAME forEach: "{{steps.get_list.result}}" forEachOptions: concurrency: 1 # 1 = Sequential; a larger number = Parallel with that many threads maxItems: 100 # only the first N items are processed continueOnError: true # skip failed items instead of stopping the loop input: - name: item value: "{{item}}" ``` * **concurrency**: how many items run at the same time. Choosing **Sequential** saves `1`; **Parallel** saves the thread count you enter. When it is not set, the loop runs with the deployment's default parallelism. * **maxItems**: process only the first N items of the list. When it is not set, all items are processed. * **continueOnError**: `true` (**Continue**, the default) skips the items that fail and keeps looping; `false` (**Stop on error**) stops the loop after the batch in which an item failed, and the remaining items are marked `skipped`. To stop right after the first failure, set `concurrency: 1`. ## Combining Options You can combine `needs`, `when`, and `forEach` in a single step: `check_enabled` stands for an earlier step in your flow whose result contains a boolean `active`. ```yaml theme={null} - id: get_items tool: INPUT_JSON input: - name: value value: '["apple", "banana", "cherry"]' - id: process_active_items tool: PYTHON_SANDBOX_RUN needs: - get_items - check_enabled when: "steps.check_enabled.result.active == true" forEach: "steps.get_items.result" input: - name: code value: | f"Processed: {item}" ``` **Evaluation Order**: 1. Wait for all `needs` steps to finish 2. If `when` is set, run only if it is true. Without `when`, the outcome of the `needs` steps decides (cancelled or skipped, as described above) 3. Execute the `forEach` loop (or a single execution if there is no `forEach`) ## Best Practices ### Dependencies * Keep dependency chains shallow when possible * Use parallel execution to improve performance * Clearly name steps to make dependencies readable ### Conditions * Use meaningful condition expressions * Consider all possible outcomes (success, failure, edge cases) * Test conditions with various input values ### Loops * Limit loop iterations to avoid long execution times * Handle empty arrays gracefully * Consider memory usage for large datasets ## Related * [YAML Coding Panel](/en/pages/basics/manifest) - Complete YAML syntax reference * [Variables & Templates](/en/pages/basics/variables) - Variable placeholders and Nunjucks templates * [Debug](/en/pages/basics/debug) - Debugging workflow execution # Variables & Templates Source: https://docs.jinba.io/en/pages/basics/variables Learn how to use variable placeholders and Nunjucks templates to create dynamic workflows ## Overview Jinba Flow supports powerful templating capabilities that allow you to: * Reference results from previous steps * Access configured secrets securely * Use Nunjucks templates for complex logic * Create dynamic, reusable workflows ## Variable Placeholders ### Basic Syntax Variables are enclosed in double curly braces: `{{ variable }}` ### Available Variables | Variable | Description | Example | | - | - | - | | `steps..result` | Result from a previous step | `{{steps.fetch_data.result}}` | | `steps..result.` | Specific property from result | `{{steps.api_call.result.content}}` | | `steps..status` | Status of a previous step (`success`, `failed`, `skipped`, `cancelled`) | `{{steps.fetch_data.status}}` | | `secrets.` | Configured workspace secret | `{{secrets.API_KEY}}` | | `item` | Current item in a forEach loop | `{{item}}` | | `item.` | Property of current item | `{{item.id}}` | | `itemIndex` | Position of the current item in a forEach loop, starting at 0 | `{{itemIndex}}` | | `itemCount` | Number of items in the forEach loop | `{{itemCount}}` | `item`, `itemIndex` and `itemCount` exist only in the inputs of a step that has `forEach`. ### Accessing Step Results ```yaml theme={null} # Access entire result - name: data value: "{{steps.previous_step.result}}" # Access specific property - name: content value: "{{steps.llm_response.result.content}}" # Access nested property - name: user_email value: "{{steps.get_user.result.user.email}}" # Access array element - name: first_item value: "{{steps.get_list.result[0]}}" ``` A plain `{{steps..result...}}` placeholder is inserted as text: * Objects and arrays become JSON * Strings are inserted as-is, without quotes * `null` or a missing value becomes an empty string This automatic conversion applies only to `steps..result...` placeholders with no filter. Other objects, such as `{{item}}` when the item is an object, render as `[object Object]`; write `{{item | json}}` instead. A step that reads another step's result must list that step in `needs`, or it may run before the result exists. See [Step Module Options](/en/pages/basics/step-options). > [!NOTE] > > `PYTHON_SANDBOX_RUN` returns its output under `result.data`, so a later step reads it as `{{steps..result.data}}`. ### Using Secrets Secrets are configured at the workspace level and accessed securely: ```yaml theme={null} config: - name: api_key value: "{{secrets.OPENAI_API_KEY}}" - name: token value: "{{secrets.GITHUB_TOKEN}}" ``` **Security Notes**: * Secrets are encrypted at rest * Never hardcode sensitive values in workflows * Use secrets for API keys, tokens, and credentials ## Nunjucks Templates Jinba Flow renders templates with [Nunjucks](https://mozilla.github.io/nunjucks/templating.html), whose syntax is close to Jinja2 but not identical. Templates are processed before step execution. ### Control Structures #### For Loops ```yaml theme={null} value: | {%- for user in steps.get_users.result %} - {{user.name}} (ID: {{user.id}}) {%- endfor %} ``` #### Conditional Statements ```yaml theme={null} value: | {%- if steps.check.result.status == 'success' %} Processing successful {%- else %} Handling error {%- endif %} ``` #### Loop with Index ```yaml theme={null} value: | {%- for entry in steps.get_list.result %} {{loop.index}}: {{entry}} {%- endfor %} ``` `loop.index` counts from 1 and `loop.index0` counts from 0. ### Built-in Functions ```yaml theme={null} # range - Generate number sequence {%- for i in range(5) %} Item {{i}} {%- endfor %} # length/count Total: {{items|length}} ``` Nunjucks has no `zip()`. To walk two lists side by side, loop over one and index the other with `loop.index0`: ```yaml theme={null} {%- for user in steps.users.result %} {{user.name}}: {{steps.orders.result[loop.index0].id}} {%- endfor %} ``` ### Filters Apply transformations to values: ```yaml theme={null} # String manipulation {{ variable | upper }} {{ variable | lower }} {{ variable | trim }} {{ variable | replace('old', 'new') }} # Default values {{ variable | default('fallback_value') }} # JSON handling {{ data | json }} # List operations {{ items | first }} {{ items | last }} {{ items | join(', ') }} ``` `default` replaces only a missing value. To also replace `null`, an empty string or `false`, write `default('fallback_value', true)`. `json` is added by Jinba Flow and outputs strict JSON: strings keep their quotes and `null` stays `null`. There is no `tojson` filter. Jinba Flow also adds filters for the output of a forEach step: | Filter | Returns | | - | - | | `successful` | The items whose status is `success` | | `failed` | The items whose status is `failed` | | `results` | The `result` of each successful item | | `pluck('key')` | The value of `key` from each item | ```yaml theme={null} Succeeded: {{ steps.batch | successful | length }} Failed: {{ steps.batch | failed | length }} ``` ### Whitespace Control Use `{%-` and `-%}` to control whitespace: ```yaml theme={null} value: | {%- for item in items -%} {{item}} {%- endfor -%} ``` * `{%-` removes whitespace before the tag * `-%}` removes whitespace after the tag ## Common Patterns The Python examples below read earlier results with `json.loads(r'''{{steps..result}}''')`. Pasting a result straight into Python code breaks on JSON values such as `null`, `true` and `false`. `PYTHON_SANDBOX_RUN` uses the value of the last line as its result; set `data_type` to `OBJECT` and end with `json.dumps(...)` to return structured data. ### Processing Lists ```yaml theme={null} - id: input_list tool: INPUT_JSON input: - name: value value: '[{"id": 1}, {"id": 2}]' - id: process_items tool: PYTHON_SANDBOX_RUN needs: - input_list input: - name: code value: | import json items = json.loads(r'''{{steps.input_list.result}}''') results = [{"id": item["id"], "processed": True} for item in items] json.dumps(results) - name: data_type value: OBJECT ``` ### Conditional Data Selection ```yaml theme={null} - id: config tool: INPUT_JSON input: - name: value value: '{"mode": "full"}' - id: full_data tool: INPUT_JSON input: - name: value value: '{"users": 120, "orders": 45, "revenue": 9800}' - id: summary_data tool: INPUT_JSON input: - name: value value: '{"users": 120}' - id: select_data tool: PYTHON_SANDBOX_RUN needs: - config - full_data - summary_data input: - name: code value: | import json {%- if steps.config.result.mode == 'full' %} data = json.loads(r'''{{steps.full_data.result}}''') {%- else %} data = json.loads(r'''{{steps.summary_data.result}}''') {%- endif %} json.dumps(data) - name: data_type value: OBJECT ``` ### Combining Multiple Sources ```yaml theme={null} - id: users tool: INPUT_JSON input: - name: value value: '[{"name": "Alice"}, {"name": "Bob"}]' - id: orders tool: INPUT_JSON input: - name: value value: '[{"id": "A-100"}, {"id": "A-101"}]' - id: merge_data tool: PYTHON_SANDBOX_RUN needs: - users - orders input: - name: code value: | import json users = json.loads(r'''{{steps.users.result}}''') orders = json.loads(r'''{{steps.orders.result}}''') combined = [ {"user": user["name"], "order": order["id"]} for user, order in zip(users, orders) ] json.dumps(combined) - name: data_type value: OBJECT ``` `zip` here is Python's, which runs inside the sandbox. In a template, use the `loop.index0` pattern shown under [Built-in Functions](#built-in-functions). ### Filtering Lists Nunjucks does not support Jinja2's `{% for x in list if condition %}`: it checks the condition once for the whole list, so the loop usually outputs nothing. Put the condition inside the loop instead: ```yaml theme={null} value: | {%- for entry in steps.get_items.result %} {%- if entry.status == 'active' %} - {{entry.name}} {%- endif %} {%- endfor %} ``` ### Building Dynamic Prompts ```yaml theme={null} - id: items tool: INPUT_JSON input: - name: value value: '[{"name": "Widget", "description": "Compact desk lamp"}, {"name": "Gadget", "description": "Wireless charger"}]' - id: generate_prompt tool: OPENAI_INVOKE needs: - items input: - name: prompt value: | Analyze the following items: {%- for item in steps.items.result %} - {{item.name}}: {{item.description}} {%- endfor %} Provide insights based on the above data. ``` ## Best Practices ### Variable References * Use descriptive step IDs for clarity * Access only the properties you need * Handle potential null/undefined values with defaults ### Templates * Keep templates readable with proper indentation * Use whitespace control for clean output * Break complex logic into multiple steps ### Secrets * Never log or expose secret values * Use workspace-level secrets for team sharing * Rotate secrets regularly ### Performance * Avoid deeply nested templates * Limit loop iterations * Pre-process data when possible ## Troubleshooting ### Common Issues **Variable not found or empty** * Check step ID spelling * Make sure the referenced step is listed in `needs` * Verify the property path is correct (for `PYTHON_SANDBOX_RUN`, the output is under `result.data`) **Template syntax error** * Check for balanced braces `{{ }}` * Verify Nunjucks tag syntax `{% %}` * Look for missing quotes in strings **Unexpected output** * Use debug steps to inspect intermediate values * Check whitespace handling * Verify data types (string vs object) * `[object Object]` means an object was inserted without conversion; add `| json` **`TemplateSecurityError: ... is not allowed in templates`** * Templates are flow-authored, so the engine refuses anything that could run code or read files, and the step fails instead of rendering * Not allowed: reading `constructor`, `prototype` or `__proto__` on any value (including a result field with that name); `{% asyncEach %}` / `{% asyncAll %}`; names that are not plain identifiers (letters, digits, `_`, `$`) as a variable, loop variable, macro, filter or test * `{% include %}`, `{% import %}` and `{% extends %}` fail separately with a "template not found" render error, because no template files are loadable from a flow * Ordinary member access, method calls on values such as `{{ steps.x.result.trim() }}`, filters, `range` and macros keep working * Front-end code with its own `{{ }}` interpolation (for example `{{ user?.name }}` in an HTML snippet) must be wrapped in `{% raw %} ... {% endraw %}` ## Related * [Step Module Options](/en/pages/basics/step-options) - forEach, when, needs * [YAML Coding Panel](/en/pages/basics/manifest) - Complete YAML syntax * [Debug](/en/pages/basics/debug) - Debugging workflows # What is Jinba Flow? Source: https://docs.jinba.io/en/pages/basics/what-is-jinba-flow A product for designing and building workflows Jinba Flow is a product for designing and building workflows. Generate flows automatically through chat, then visually review and edit them with an intuitive flowchart interface. Workflows can be published as APIs or batch processes for easy reuse. ![Jinba Flow Editor](https://mintcdn.com/jinba/B0KuFPdq9oF6s05P/en/images/flow_editor_en.png?fit=max\&auto=format\&n=B0KuFPdq9oF6s05P\&q=85\&s=89b52eec9376c61b2da96cc7b0b27cff) ## Workflow Automation in 3 Steps **1. Build** **Auto-generate workflows with natural language** > [card] [Natural Language Creation](./chat) > > Describe what you want and get instant flow generation > [card] Visual Editing > > Intuitive drag & drop for flexible editing and building > [card] [Advanced Logic](../architecture/execution-model) > > Supports complex logic: branches, loops, and more **2. Run** **Diverse tools & secure AI integration** > [card] [100+ Integrations](../credentials/index) > > Connect Slack, Gmail, Notion, GitHub, Python, and more > [card] [LLM Integration](../tools/ai/anthropic) > > Easily integrate GPT, Claude, Gemini via MCP > [card] Secure Execution > > Safe execution environment for advanced business tasks **3. Deploy** **One-click publish and operate** > [card] [API Publishing](./publish) > > Deploy instantly as REST API > [card] [MCP Integration](./mcp) > > Publish as MCP server for agent integration > [card] System Integration > > Easy to call from existing systems and apps ## Use Cases > [card] [Slack Automation](../tools/communication/slack) > > Monitor channels, summarize discussions, and post updates automatically > [card] Data Pipelines > > Extract, transform, and load data across multiple sources > [card] [AI Analysis](../tools/ai/anthropic) > > Process documents with AI for extraction, summarization, and insights ## Enterprise Features For organizations requiring advanced security and control: * **Private Hosting**: On-premises or private cloud deployment * **SSO & RBAC**: Single Sign-On and role-based access control * **Audit Logs**: Detailed tracking for compliance * **Dedicated Support**: Engineering support for workflow development * **Private Models**: Use AWS Bedrock, Azure AI, or custom models ## Get Started > [card] [Quickstart](./quickstart) > > Build your first workflow in 10 minutes > [card] [Core Concepts](./core-concepts) > > Learn the key terms and concepts # Manage a Jinba Flow Workspace Source: https://docs.jinba.io/en/pages/basics/workspace Understand workspace types, files, members, and roles before managing a Jinba Flow workspace. ![The workspace home. Create flows in natural language, and access flows, storage, secrets, and admin features from the sidebar](https://mintcdn.com/jinba/B0KuFPdq9oF6s05P/en/pages/basics/images/screens/workspace-home.png?fit=max\&auto=format\&n=B0KuFPdq9oF6s05P\&q=85\&s=0fe4656b288fa4e28467d6f5fa189c45) The workspace home. Create flows in natural language, and access flows, storage, secrets, and admin features from the sidebar ## What is a Workspace? A workspace in Jinba Flow is your personal or team environment where you create, manage, and execute workflows. Think of it as your dedicated space for organizing all your automation projects, credentials, and configurations. ## Key Features of Workspaces ### Flow Management * **Create and Organize Flows**: Build multiple workflows within a single workspace * **Version Control**: Track changes and manage different versions of your flows * **Flow Sharing**: Share flows with team members or make them public * **Flow Templates**: Save and reuse common workflow patterns * **Import and Export as YAML**: Create a flow from a YAML file or pasted YAML, and download any flow — or a selection of flows, as a ZIP — as YAML from the flow list menu ### Credentials Management * **Secure Storage**: Store API keys and OAuth credentials securely * **Service Integration**: Configure credentials for various external services * **Access Control**: Manage who can access which credentials * **Credential Organization**: Organize credentials by service type or project ### Settings and Configuration * **Workspace Settings**: Customize workspace preferences and behavior * **Team Management**: Invite team members and manage permissions * **Billing and Subscriptions**: Manage your subscription plan and billing information * **Usage Monitoring**: Track credit usage and workflow execution statistics under **Management → Usage** in the sidebar. Workspace owners see it in every workspace, including a personal one; in an organization workspace the Management menu also has **Approval** for all members and **Operation Logs** for owners ### Files and Storage Management * **File Storage**: Upload, organize, and manage files in your workspace * **File Sharing**: Share files using temporary links or permanent URIs * **Knowledge Bases**: Create and manage vector databases for RAG systems * **Tables**: Store structured records that flows can read and write * **Output Files**: Access files generated by workflow executions from the flow editor ### MCP Integration * **MCP Server Setup**: Configure your workspace as an MCP server * **Flow Exposure**: Expose your flows as MCP tools for use with LLMs * **Parameter Configuration**: Set up input parameters for MCP-enabled flows ## Workspace Types ### Personal Workspace A personal workspace is your individual space where you can: * Create and manage your own workflows * Store personal credentials * Track your own usage and credits * Access all basic features ### Team Workspace (Enterprise) Team workspaces provide additional collaboration features: * **Shared Resources**: Share flows, credentials, and configurations with team members * **Role-Based Access**: Assign different roles and permissions to team members * **Team Analytics**: View team-wide usage statistics and performance metrics * **Approval Workflows**: Implement approval processes for critical operations * **Organization Management**: Manage multiple teams and workspaces under one organization ## Getting Started with Your Workspace 1. **Access Your Workspace**: Log in to Jinba Flow and navigate to your workspace dashboard 2. **Create Your First Flow**: Use the Chat Panel, Graph Editor, or YAML Coding Panel to create workflows 3. **Configure Credentials**: Set up API keys and OAuth connections for the services you want to use 4. **Upload Files** (Optional): Upload files to your workspace storage for use in workflows 5. **Set Up MCP** (Optional): Configure your workspace MCP server to expose flows to LLMs 6. **Monitor Usage**: Keep track of your credit consumption and workflow executions ## Files and Storage ### File Management Your workspace includes a Storage section where you can: * **Upload Files**: Store documents, data files, and other resources * **Organize Files**: Search, sort, and manage your file collection * **Share Files**: Generate temporary links or permanent URIs for file sharing * **Use in Workflows**: Reference files using permanent URIs (`jinbaflow://{file-id}`). A flow only resolves files from its own workspace. When you copy or fork a flow into another workspace, the files its steps reference are copied there with it; a file you cannot read in the source workspace is left out, and the copied flow reports it so you can re-select it A file upload is limited to 10 MB, or 30 MB for tabular files (CSV, TSV, XLS, XLSX, XLSM, ODS, Parquet). Uploads are rate limited; when some files of a batch are rejected, they stay in the upload list so you can retry them. ### Storage Access Access storage from the workspace sidebar: 1. Click **Storage** in the sidebar 2. Use the **Files** tab for file management 3. Use the **Knowledge Bases** tab for vector database management Tables have their own entry, **Tables**, in the sidebar. ### Files in Workflows Files stored in your workspace can be: * **Referenced as Input**: Use permanent URIs to reference files in workflow steps * **Generated as Output**: Save workflow results as files * **Processed**: Use file processing tools to extract, convert, or analyze content ### Knowledge Bases Knowledge bases enable RAG (Retrieval-Augmented Generation) functionality: * **Create Knowledge Bases**: Set up vector databases for semantic search * **Upload Documents**: Add PDFs, DOCX, and text files for indexing * **Automatic Processing**: Documents are automatically chunked and vectorized * **Vector Search**: Use semantic search to find relevant information For detailed information on building RAG systems, see [Knowledge](/en/pages/basics/knowledge). ### Tables Tables are a workspace-scoped structured data store that flows can read and write. Open **Tables** in the sidebar to: * **Create tables** and add columns of type Text, Long text, Number, Checkbox, Date & time, Select, Multi-select, JSON or Link, optionally with a default value or a required constraint * **Edit records** directly in the grid, add them one by one or through a form, paste rows, or import a CSV or Excel file * **Organize** tables into folders, copy or rename them, and restore deleted tables and records from the trash * **Use them in flows** with the `JINBA_TABLE_*` tools — see [Jinba Tools](/en/pages/tools/jinba/jinba) Every record has a system **Record ID** column; clicking it copies the ID that `JINBA_TABLE_UPDATE_RECORD` needs. In the flow editor, the Storage modal also has a **Tables** tab for viewing and editing records without leaving the flow. ## Workspace Members and Roles ### Understanding Workspace Roles Workspaces support different roles that determine what members can do: #### Owner The **Owner** role has full access to the workspace: * **Full Workspace Control**: Manage all workspace settings and configurations * **Member Management**: Invite new members, remove members, and change member roles * **Resource Management**: Create, update, delete, and manage all flows, credentials, and files * **Workspace Deletion**: Can delete the workspace (requires at least one owner to remain) * **MCP Configuration**: Full access to MCP server configuration * **Operation Logs**: View operation logs and audit trails **Important**: Every workspace must have at least one owner. You cannot remove the last owner from a workspace. #### Member The **Member** role has standard access to workspace resources: * **Flow Management**: Create, run, update, and delete flows * **Resource Access**: View and use shared credentials and files * **Limited Settings**: Cannot modify workspace settings or manage members * **No Member Management**: Cannot invite or remove other members ### Adding Members to Your Workspace To add members to your workspace: 1. **Navigate to Workspace Settings**: Go to your workspace settings page 2. **Open Members Section**: Click on the "Members" or "Team" tab 3. **Invite Member**: Click the "Invite Member" button 4. **Enter Email**: Enter the email address of the user you want to invite 5. **Select Role**: Choose the appropriate role (Owner or Member) 6. **Send Invitation**: The user will be added to the workspace with the selected role **Requirements for Inviting Members**: * You must be an **Owner** of the workspace to invite members * The user must already have a Jinba Flow account (they will be found by email) * Your subscription plan must support the number of team members you're adding * Enterprise plans have higher member limits ### Adding Organization Members Being a member of the organization does not grant access to its workspaces on its own: a user joins a workspace when they are invited, when they created it, or when an organization owner adds them. In an organization workspace, organization owners see an **Add organization members** button next to the invite button in the Members section (and on the workspace's page under the organization). It adds the selected organization members — or all of them — as workspace **Members** in one step; people already in the workspace are skipped. A member added this way is removed from the workspace automatically when they leave the organization. ### Workspace Addition Emails When an existing account is added to a workspace, the new member receives an email with the workspace name, assigned role, and a link to open that workspace. This also applies to members added through bulk additions or team synchronization. If sign-in is required, sign in with the account that was added to continue to the workspace. The email uses the recipient's language preference saved by selecting English or Japanese in Jinba Flow. If no preference has been saved, the email is in English. ### Teams When your organization's identity provider syncs teams to Jinba, organization owners can attach a team to a workspace from the **Teams** card at the top of the Members section. The members of an attached team are kept in sync as workspace members: people who join the team are added, people who leave it are removed. Manually added members and owners are not affected. A member who comes from a team is labelled with the team name and cannot be edited directly — detach the team, or change its members in the identity provider. Detaching a team removes the members it added unless they belong to another attached team, were added manually, or are owners. ### Managing Member Roles As a workspace owner, you can: * **Change Roles**: Update a member's role at any time * **Remove Members**: Remove members from the workspace (except the last owner) * **View Member List**: See all current members and their roles * **Monitor Activity**: View member activity and usage statistics **Note**: When you change a member's role, their permissions are updated immediately. Be careful when removing owner access, as owners have critical permissions. ### Workspace Ownership * **Initial Owner**: The user who creates a workspace automatically becomes the first owner * **Multiple Owners**: You can have multiple owners in a workspace for shared management * **Owner Requirements**: A workspace must always have at least one owner * **Transfer Ownership**: You can promote other members to owner role, but cannot remove the last owner ## Workspace Best Practices * **Organize by Project**: Create separate flows for different projects or use cases * **Use Descriptive Names**: Name your flows and credentials clearly for easy identification * **Regular Cleanup**: Archive unused flows to keep your workspace organized * **Monitor Credits**: Regularly check your credit usage to optimize workflow costs * **Secure Credentials**: Never share API keys and regularly rotate them for security * **Manage Access**: Regularly review member roles and remove access for users who no longer need it * **Role Assignment**: Assign the minimum necessary role to members (principle of least privilege) ## Related Features * [Model Context Protocol (MCP)](/en/pages/basics/mcp) - Learn how to set up MCP for your workspace * [Credit Costs](/en/pages/basics/credit-costs) - Understand how credits work and are consumed * [Archive Feature](/en/pages/basics/archive) - Learn how to archive and restore flows # Explore Jinba Flow Enterprise Features Source: https://docs.jinba.io/en/pages/enterprise/index Review Jinba Flow enterprise capabilities and find setup guidance for organizations. Use this page to find the Enterprise capabilities available in Jinba Flow and the organization setup guide. ## Review Enterprise capabilities Jinba Flow Enterprise provides advanced features designed for organizations that require enhanced security, compliance, and management capabilities. These features are available exclusively with the Enterprise plan. ## Enterprise Features * Workspace permission management by team and individual * Automatic archiving of inactive workspaces * Approval and restrictions for tool publishing * Feature selection through on/off flags * Access restrictions to external tools * On-premises and private cloud support * Audit logs * Role-based access with SSO authentication * Private LLM model support ### On-premises or Private Cloud Hosting Run Jinba in your own environment with complete data control. * **Complete Data Control**: All data remains within your infrastructure * **Custom Deployment**: Deploy on your own servers or private cloud * **Network Isolation**: Keep your workflows and data isolated from public cloud * **Compliance Ready**: Meet strict regulatory requirements with on-premises deployment ### Advanced Access Control Enhanced security and management through role-based permissions and Single Sign-On (SSO) integration. * **Role-Based Access Control (RBAC)**: Define custom roles with granular permissions * **Single Sign-On (SSO)**: Integrate with your existing identity provider (SAML, OAuth, etc.) * **Multi-Factor Authentication (MFA)**: Add an extra layer of security * **Session Management**: Control user sessions and access tokens ### Audit Logs Detailed tracking capabilities for compliance and security monitoring. * **Comprehensive Activity Logging**: Track all user actions and system events * **Compliance Reporting**: Generate reports for regulatory compliance * **Security Monitoring**: Detect and alert on suspicious activities * **Data Retention**: Configure log retention policies according to your requirements ### Organization Management Team spaces, roles, and approval workflows for efficient organization-wide management. * **Team Workspaces**: Organize users and workflows into dedicated spaces * **Approval Workflows**: Implement multi-level approval processes for critical operations * **Resource Quotas**: Set limits and quotas for teams and users * **Centralized Administration**: Manage all aspects of your organization from a single dashboard ### Pre-built and Custom Integrations Access to 100+ pre-built integrations plus custom connectors for internal systems. * **100+ Pre-built Integrations**: Connect with popular services out of the box * **Custom Connectors**: Build integrations for your internal systems and APIs * **API Gateway**: Secure access to your internal services * **Integration Support**: Get assistance from our team for complex integrations ### Dedicated Engineer Support Dedicated engineers provide workflow development support to remove development barriers. * **Technical Support**: Direct access to our engineering team * **Workflow Development**: Get help building and optimizing your workflows * **Best Practices**: Learn industry best practices and optimization techniques * **Priority Support**: Faster response times for critical issues ### Private Model Hosting Securely use AWS Bedrock, Azure AI, or your own models. * **AWS Bedrock Integration**: Use Amazon Bedrock models securely * **Azure AI Integration**: Connect to Azure OpenAI and other Azure AI services * **Custom Model Hosting**: Deploy and use your own AI models * **Model Governance**: Control which models are available to your organization ## Getting Started with Enterprise To learn more about Enterprise features and pricing, please contact our sales team: * **Email**: [contact@carnot.ai](mailto:contact@carnot.ai) * **Support**: Reach out through your account dashboard ## Additional Resources * [Security Documentation](/en/pages/security/index) * [SSO Setup Guide](https://github.com/carnot-technologies/jinba-flow/tree/main/docs/sso) * [Deployment Guide](https://github.com/carnot-technologies/jinba-flow/blob/main/README-DEPLOYMENT.md) # Organizations & Member Invitations Source: https://docs.jinba.io/en/pages/enterprise/organization The user journey from inviting a member to an organization to them joining it ## Overview Jinba has an "Organization" layer that spans multiple products (Jinba Flow, Jinba App, and others), which centrally manages the invitation and joining of members. * There are two roles within an organization: **MEMBER** and **OWNER**. * Only global administrators can create new organizations. Regular users cannot create organizations. ## Inviting a member (as the owner)