Workflow Builder Documentation

Create, export, and embed visual API workflows with OpenAPI integration

Table of Contents

Getting Started

  • • Quick Start Guide
  • • 🔧 Test Viewer
  • • OpenAPI Integration
  • • Creating Workflows
  • • Node Configuration

Export & Integration

  • • Download Files & Demo
  • • Export Options
  • • Local CDN Integration
  • • Code Examples
  • • Embedding Guide
  • • Best Practices
Quick Start Guide

Build visual API workflows in 4 simple steps. Perfect for documenting complex API interactions and creating embeddable workflow diagrams.

1

Upload OpenAPI Schema

Drag & drop your OpenAPI JSON/YAML file or click “Load Sample OpenAPI” to get started with pre-built endpoints

2

Drag API Endpoints

Drag API endpoints from the left sidebar onto the canvas to create workflow nodes with automatic configuration

3

Connect Workflow Steps

Connect nodes using success (✅) and failure (❌) handles to build logical workflow paths

4

Export & Embed

Choose “Export Workflow” for editing or “Export for Embed” for website integration

🎯 Pro Tip: Start with Sample Data

Click “Load Sample OpenAPI” and “Load Sample Workflow” to explore features with pre-built content before uploading your own API schema.

🔧 Test Viewer

Use the Test Viewer to preview and test workflow visualizations with different themes and sample data.

🚀 Quick Testing

Test your workflow visualizations with predefined samples or custom JSON data.

Load sample workflows (E-commerce, OpenAPI, Embed flows)
Test both direct file access and API endpoints
Switch between light, dark, and auto themes
Preview JSON data and test custom workflow uploads
OpenAPI Integration

Schema Upload & Parsing

Support for OpenAPI 3.0 JSON and YAML formats with automatic endpoint parsing and validation

Drag & Drop Interface

Intuitive drag-and-drop interface to add API endpoints to your workflow canvas

Endpoint Details

Automatic parsing of HTTP methods, paths, descriptions, tags, and operation IDs

Visual Workflow Canvas

Success Flow Paths

Green connectors (✅) represent successful API call paths and positive outcomes

Error Handling

Red connectors (❌) represent error handling paths and fallback scenarios

Node Customization

Click nodes to edit names, descriptions, images, and documentation links

Detailed Step-by-Step Instructions

1. Setting Up Your OpenAPI Schema

Upload:Drag & drop your OpenAPI JSON/YAML file into the left sidebar upload area
Sample:Click “Load Sample OpenAPI” to try with pre-built endpoints and explore features
Validation:The system automatically validates your schema and displays parsing results
Search:Use the search bar to filter endpoints by name, path, HTTP method, or tags

2. Creating Workflow Nodes

Drag:Drag API endpoints from the sidebar directly onto the canvas
Configure:A configuration modal opens automatically for each new node
Customize:Add custom descriptions, upload images, and include documentation links
Edit:Click the edit button (✏️) on any node to modify configuration later

3. Connecting Workflow Steps

Success Path:Drag from the green handle (✅) to connect successful API response flows
Error Path:Drag from the red handle (❌) to connect error handling and fallback paths
Multiple:Each node can have multiple outgoing connections for complex workflows
Visual:Connections are color-coded and labeled for easy understanding

4. Export & Import Workflows

Export Workflow:Full export with OpenAPI schema for re-editing and backup
Export for Embed:Lightweight export optimized for external website integration
Import File:Upload previously exported workflow JSON files from your computer
File Formats:Full workflows (*_workflow.json) and embed flows (*_embed_flow.json)
Node Configuration Options

Basic Information

Node Name

Custom display name for the workflow step (overrides API endpoint name)

Description

Detailed explanation of what this step does in your workflow

Documentation Link

Link to external API documentation or additional resources

Visual Customization

Image Upload

Upload local images for visual representation of the API endpoint

External Image URL

Use images from external URLs (consider CORS policies)

Auto-generated Info

HTTP method, path, and operation ID automatically extracted from OpenAPI

Export Options Explained

Choose the right export format based on your use case. Each option is optimized for different scenarios.

📦 Export Workflow
Full Export

Purpose:Complete backup with OpenAPI schema
File Size:Larger - includes full schema data
Format:*_workflow.json naming
Contains:Nodes, edges, OpenAPI schema, metadata
Best For:Re-editing, backup, sharing

🚀 Export for Embed
Lightweight

Purpose:Website embedding & integration
File Size:Smaller - no OpenAPI schema
Format:*_embed_flow.json naming
Contains:Nodes, edges, visual data only
Best For:External embedding, fast loading

💡 When to Use Each Export Option

Use “Export Workflow” when:
  • • You want to edit the workflow later
  • • Creating backups for version control
  • • Sharing with other developers
  • • You need the complete OpenAPI schema
Use “Export for Embed” when:
  • • Embedding in external websites
  • • Creating documentation diagrams
  • • Optimizing for fast web loading
  • • You only need the visual workflow
Download Files & Live Demo

Download the required files and see the workflow viewer in action.

Public CDN URLs (Recommended)

Use these URLs to include the workflow viewer in any website without downloading files:

CSS
https://od2.in/api-wd/workflow-viewer.css
JavaScript
https://od2.in/api-wd/workflow-viewer.js
Copy-Paste Integration:
<link rel="stylesheet" href="https://od2.in/api-wd/workflow-viewer.css">
<script src="https://od2.in/api-wd/workflow-viewer.js"></script>

JavaScript File

Main workflow viewer script with all functionality

Download JS
workflow-viewer.js (~15KB)

CSS Styles

Themes and styling for the workflow viewer

Download CSS
workflow-viewer.css (~8KB)

Public CDN Demo

Interactive demo with CDN integration examples and theme switching

Open Demo
Opens in new tab

Additional Test Pages

Both pages open in new tabs for easy testing alongside your development

Quick Start Guide

  1. 1.Download both files using the buttons above
  2. 2.Upload files to your website's /api-wd/ directory (or any path)
  3. 3.Export your workflow using “Export for Embed”
  4. 4.Include the files and use od2ApiWorkflowRenderer()
  5. 5.Check the live demo for examples and inspiration

CDN URLs for Your Website

CSS File:
https://od2.in/api-wd/workflow-viewer.css
JavaScript File:
https://od2.in/api-wd/workflow-viewer.js

Use the OD2 public CDN URLs for instant access, or download and host the files yourself.

Local CDN Integration Guide

Embed your workflows in any website using our self-hosted CDN files. No external dependencies, full control over hosting and versioning.

📦 Integration Process

  1. 1.Build your workflow in the OD2 Workflow Builder
  2. 2.Click “Export for Embed” to create an optimized embed flow JSON file
  3. 3.Download the files from OD2 CDN or copy them to your website
  4. 4.Save the *_embed_flow.json file to your website directory
  5. 5.Include the CDN files and initialize the viewer with your JSON

Simple API (Recommended)

Use the global od2ApiWorkflowRenderer function for quick and easy embedding:

<!DOCTYPE html>
<html>
<head>
  <!-- Include OD2 Public CDN -->
  <link rel="stylesheet" href="https://od2.in/api-wd/workflow-viewer.css">
  <script src="https://od2.in/api-wd/workflow-viewer.js"></script>
</head>
<body>
  <!-- Workflow Container -->
  <div id="my-workflow" style="height: 500px;"></div>
  
  <!-- Simple API - just pass container ID and JSON data -->
  <script>
    // Your workflow data (from API, file, or inline)
    const workflowData = {
      name: "My Workflow",
      nodes: [...],
      edges: [...]
    };
    
    // Render the workflow
    od2ApiWorkflowRenderer('my-workflow', workflowData);
  </script>
</body>
</html>

Advanced API

For more control, use the full OD2WorkflowViewer API:

<!DOCTYPE html>
<html>
<head>
  <!-- Include OD2 Public CDN -->
  <link rel="stylesheet" href="https://od2.in/api-wd/workflow-viewer.css">
  <script src="https://od2.in/api-wd/workflow-viewer.js"></script>
</head>
<body>
  <!-- Workflow Container -->
  <div id="my-workflow" style="height: 500px;"></div>
  
  <!-- Initialize Viewer -->
  <script>
    OD2WorkflowViewer.render({
      container: '#my-workflow',
      workflowUrl: './my-workflow_embed_flow.json',
      theme: 'light',
      fitView: true,
      interactive: true
    });
  </script>
</body>
</html>

Simple API Usage

Basic function call:

od2ApiWorkflowRenderer(containerId, jsonData)

With options:

od2ApiWorkflowRenderer('my-workflow', data, { theme: 'dark', height: '600px', interactive: true })

Configuration Options

containerCSS selector or DOM element
workflowUrlPath to embed flow JSON
theme‘light’, ‘dark’, or ‘auto’
interactiveEnable pan/zoom/drag
fitViewAuto-fit to container

Local CDN Benefits

  • No external dependencies
  • Full control over versioning
  • No CORS issues
  • Faster loading from your domain
  • Customizable and brandable
Best Practices & Troubleshooting

✅ Best Practices

Export Strategy:

Always use “Export for Embed” for website integration to ensure optimal file size and loading performance

Testing:

Test embed flow JSON files in a staging environment before production deployment

Container Setup:

Set explicit container dimensions (height/width) for consistent layout across devices

Documentation:

Include API documentation links in nodes for interactive and informative workflows

Mobile UX:

Consider using interactive: false for mobile users to improve touch interaction

⚠️ Common Issues

Wrong Export:

Using full workflow export instead of embed flow export causes slower loading and larger file sizes

Missing Height:

Not setting container height causes layout issues and invisible workflow displays

CORS Errors:

External image URLs may be blocked by CORS policies - use local images when possible

Script Loading:

Scripts loading before DOM is ready - ensure proper script placement or use DOMContentLoaded

JSON Fetch:

Missing error handling for JSON fetch failures - check network tab for loading issues

Keyboard Shortcuts & Navigation

Canvas Navigation

Mouse WheelZoom in/out
Click + DragPan canvas
Ctrl + ScrollFine zoom

Node Actions

ClickSelect node
DragMove node
DeleteRemove selected

Workflow Actions

Ctrl + SQuick export
Ctrl + OImport file
F11Fullscreen
Code Examples & Implementation Details

Complete implementation examples and function details for the od2ApiWorkflowRenderer function.

Function Signature

// Global function available after including workflow-viewer.js
od2ApiWorkflowRenderer(containerId, workflowData, options)

Parameters:
  containerId  (string)  - Container element ID (without #)
  workflowData (object)  - Workflow JSON from "Export for Embed"
  options      (object)  - Optional configuration object

Returns:
  WorkflowRenderer instance for advanced control

Basic Implementation

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>My API Workflow</title>
  
  <!-- Include OD2 Workflow Viewer CSS -->
  <link rel="stylesheet" href="https://od2.in/api-wd/workflow-viewer.css">
</head>
<body>
  <!-- Container with explicit dimensions -->
  <div id="api-workflow" style="
    width: 100%;
    height: 500px;
    border: 1px solid #ddd;
    border-radius: 8px;
  "></div>

  <!-- Include OD2 Workflow Viewer JavaScript -->
  <script src="https://od2.in/api-wd/workflow-viewer.js"></script>
  
  <script>
    // Load and render workflow
    fetch('./my-api-workflow_embed_flow.json')
      .then(response => response.json())
      .then(workflowData => {
        od2ApiWorkflowRenderer('api-workflow', workflowData);
      })
      .catch(error => {
        console.error('Failed to load workflow:', error);
      });
  </script>
</body>
</html>

Advanced Configuration

// Advanced usage with all configuration options
od2ApiWorkflowRenderer('my-workflow', workflowData, {
  // Visual Options
  theme: 'dark',              // 'light', 'dark', or 'auto'
  width: '100%',              // Container width
  height: '600px',            // Container height
  
  // Interaction Options
  interactive: true,          // Enable pan/zoom/drag
  showControls: true,         // Show zoom controls
  fitView: true,             // Auto-fit workflow to container
  
  // Event Handlers
  onNodeClick: function(node) {
    console.log('Node clicked:', node.data.name);
    
    // Open API documentation
    if (node.data.apiDocumentationLink) {
      window.open(node.data.apiDocumentationLink, '_blank');
    }
    
    // Custom analytics tracking
    analytics.track('workflow_node_clicked', {
      nodeName: node.data.name,
      method: node.data.method,
      path: node.data.path
    });
  },
  
  // Error Handling
  onError: function(error) {
    console.error('Workflow error:', error);
    alert('Failed to load workflow: ' + error.message);
  }
});

🚀 Performance & Best Practices

Optimization Tips:
  • • Use “Export for Embed” for smaller file sizes
  • • Set explicit container dimensions
  • • Implement proper error handling
  • • Cache workflow JSON files when possible
  • • Use theme: ‘auto’ for system preference
Security Notes:
  • • Validate JSON data before rendering
  • • Use HTTPS for external resources
  • • Sanitize user-provided URLs
  • • Implement CSP headers for security
  • • Avoid exposing sensitive API data

Need Additional Help?

Ensure your embed flow JSON is properly formatted and accessible from your website. For OpenAPI schema issues, verify that each endpoint includes an operationId.

Check browser console for loading errors and verify all local CDN files are properly hosted.