Skip to main content
The WorkflowContainer is a wrapper that encapsulates a workflow along with its associated metadata. This structure is used to package a workflow for deployment or execution.

Structure

export interface WorkflowContainer {
    url: string;
    prompt: string;
    workflow: Workflow;
}

Properties

url
string
required
The URL where the workflow JSON can be accessed.
prompt
string
required
The initial prompt or instructions for the AI model that will be executing this workflow. This should provide context and guidelines for the AI’s behavior throughout the workflow.
workflow
Workflow
required
The actual workflow definition. This includes the entire structure of the workflow, including its server configuration, tools, events, and state machine.

Usage

The WorkflowContainer is typically used when you want to deploy or share a complete workflow package. It combines the workflow definition with necessary metadata to ensure that the workflow can be properly initialized and executed. Example:
const myWorkflowContainer: WorkflowContainer = {
    url: "https://api.example.com/workflows/my-workflow",
    prompt: "You are an AI assistant helping with customer inquiries. Follow the workflow to guide the conversation.",
    workflow: {
        // ... (workflow definition)
    }
};
This structure allows for easy distribution and initialization of workflows, ensuring that all necessary components are bundled together.