Skip to main content

Workflow Embedding

NetPad supports embedding workflows in external sites for documentation, tutorials, and sharing workflow designs. Workflows can be embedded in read-only viewer mode for visualization.

Embedding Methodsโ€‹

There are two ways to embed workflows:

MethodUse CaseRequirements
WorkflowViewerStatic workflow definitions in docsWorkflow JSON definition
WorkflowEmbedLive workflows from NetPadRunning NetPad instance

Use WorkflowViewer to render workflow definitions directly in your documentation. No external dependencies required.

Loading workflow...

WorkflowViewer Propsโ€‹

PropTypeDefaultDescription
workflowobjectrequiredWorkflow definition (nodes & edges)
heightnumber/string500Viewer height
titlestring-Title above viewer
descriptionstring-Description text
minimapbooleantrueShow minimap
controlsbooleantrueShow zoom controls
layoutDirectionstring'TB''TB', 'BT', 'LR', 'RL'
autoLayoutbooleantrueAuto-position nodes

Usageโ€‹

<WorkflowViewer
title="My Workflow"
height={400}
workflow={{
nodes: [
{ id: '1', type: 'form_trigger', data: { label: 'Start' } },
{ id: '2', type: 'email_send', data: { label: 'Notify' } }
],
edges: [
{ id: 'e1', source: '1', target: '2' }
]
}}
/>

Method 2: WorkflowEmbed (Live Workflows)โ€‹

Use WorkflowEmbed to embed live workflows from a running NetPad instance.

Loading workflow...
Prerequisites

For WorkflowEmbed to work, you need:

  1. NetPad running at the configured baseUrl
  2. A workflow with the specified slug
  3. "Allow public viewing" enabled in workflow Embed settings

Embedding in Docusaurus/MDXโ€‹

Use the WorkflowEmbed component directly in your MDX files:

<WorkflowEmbed
workflowSlug="your-workflow-slug"
theme="auto"
height="500px"
/>

Component Propsโ€‹

PropTypeDefaultDescription
workflowSlugstringrequiredThe workflow slug to embed
themestring'auto''light', 'dark', or 'auto'
hideHeaderbooleanfalseHide the header bar
hideBrandingbooleanfalseHide NetPad branding
heightstring'500px'Container height
baseUrlstring'https://netpad.io'NetPad base URL

Examplesโ€‹

Dark theme with hidden header:

Loading workflow...
<WorkflowEmbed
workflowSlug="it-helpdesk-router"
theme="dark"
hideHeader={true}
height="400px"
/>

Embedding in Other Sitesโ€‹

Method 1: Data Attributes (Auto-Initialization)โ€‹

The simplest way to embed a workflow viewer in non-React sites:

<script src="https://www.netpad.io/workflow-embed.js"></script>
<div
data-netpad-workflow-viewer="your-workflow-slug"
data-theme="dark"
data-hide-header="true"
data-hide-branding="true"
style="height: 500px;"
></div>

Method 2: JavaScript SDKโ€‹

For more control, use the JavaScript API:

<div id="workflow-container"></div>

<script src="https://www.netpad.io/workflow-embed.js"></script>
<script>
NetPad.embedViewer('workflow-container', 'your-workflow-slug', {
theme: 'auto',
hideHeader: false,
hideBranding: false,
height: '600px',
metadata: true,
onLoad: function() {
console.log('Workflow viewer loaded');
},
onError: function(error) {
console.error('Error loading workflow:', error);
}
});
</script>

Method 3: iframeโ€‹

Direct iframe embedding:

<iframe
src="https://www.netpad.io/workflows/view/your-workflow-slug?embedded=true&theme=dark&hideHeader=true"
width="100%"
height="600"
frameborder="0"
style="border-radius: 8px;"
></iframe>

Configuration Optionsโ€‹

Data Attributesโ€‹

AttributeValuesDescription
data-netpad-workflow-viewerworkflow slugThe workflow to embed
data-themelight, dark, autoColor theme
data-hide-headertrue, falseHide the header bar
data-hide-brandingtrue, falseHide NetPad branding

JavaScript SDK Optionsโ€‹

OptionTypeDefaultDescription
themestring'auto''light', 'dark', or 'auto'
hideHeaderbooleanfalseHide header bar
hideBrandingbooleanfalseHide NetPad branding
heightstring'400px'Container height
widthstring'100%'Container width
metadatabooleanfalseInclude metadata (stats, variables)
onLoadfunction-Callback when loaded
onErrorfunction-Error callback

URL Parameters (iframe)โ€‹

ParameterValuesDescription
embeddedtrueEnable embedded mode
themelight, dark, autoColor theme
hideHeadertrueHide header bar
hideBrandingtrueHide NetPad branding
metadatatrueInclude metadata

SDK Return Objectโ€‹

The embedViewer function returns an object with control methods:

const embed = NetPad.embedViewer('container', 'workflow-slug', options);

// Get the iframe element
console.log(embed.iframe);

// Reload the viewer
embed.reload();

// Remove the embed
embed.destroy();

Enabling Public Viewingโ€‹

Before a workflow can be embedded, you must enable public viewing:

  1. Open the workflow in the editor
  2. Click the Settings (gear icon)
  3. Go to the Embed tab
  4. Enable "Allow public viewing (read-only)"
  5. Save settings

Security Notesโ€‹

  • Embedded workflows are read-only - users cannot edit or execute them
  • Only workflows with allowPublicViewing enabled can be embedded
  • Sensitive data (connection strings, API keys) is never exposed
  • No authentication required for viewing

Use Casesโ€‹

Documentationโ€‹

Embed workflow diagrams in your documentation to show users how automations work.

Tutorialsโ€‹

Include interactive workflow examples in blog posts and tutorials.

Sharingโ€‹

Share workflow designs with stakeholders who don't need execution access.

Portfoliosโ€‹

Showcase your workflow designs in portfolios or case studies.

Comparison: Viewer vs Executionโ€‹

FeatureViewer EmbedExecution Embed
PurposeDocumentationAutomation
Read-OnlyYesNo
Can ExecuteNoYes
Shows StructureYesNo
Shows StatusNoYes
Requires TokenNoOptional

Next Stepsโ€‹