> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mrassistant.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Workflow

> Create a new workflow for agent conversation flow.



## OpenAPI

````yaml https://api.mrassistant.ai/openapi.json post /workflows
openapi: 3.1.0
info:
  title: Backend - Multilingual Voice Agent System
  description: FastAPI backend for multilingual voice agents with tool use
  version: 1.0.0
servers: []
security: []
paths:
  /workflows:
    post:
      tags:
        - workflows
      summary: Create Workflow
      description: Create a new workflow for agent conversation flow.
      operationId: create_workflow_workflows_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workflow'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    WorkflowCreate:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        nodes:
          items:
            $ref: '#/components/schemas/WorkflowNode'
          type: array
          title: Nodes
        edges:
          items:
            $ref: '#/components/schemas/WorkflowEdge'
          type: array
          title: Edges
        global_nodes:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Global Nodes
        globalPrompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Globalprompt
      type: object
      required:
        - name
        - nodes
        - edges
      title: WorkflowCreate
      description: Workflow creation model.
    Workflow:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        tenant_id:
          type: string
          format: uuid
          title: Tenant Id
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        nodes:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Nodes
        edges:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Edges
        global_nodes:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Global Nodes
        status:
          type: string
          title: Status
        version:
          type: integer
          title: Version
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - tenant_id
        - name
        - nodes
        - edges
        - status
        - version
        - created_at
        - updated_at
      title: Workflow
      description: Workflow response model.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    WorkflowNode:
      properties:
        id:
          type: string
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        type:
          type: string
          pattern: ^(conversation|tool)$
          title: Type
        isStart:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Isstart
          default: false
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
        prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Prompt
        messagePlan:
          anyOf:
            - $ref: '#/components/schemas/MessagePlan'
            - type: 'null'
        variableExtractionPlan:
          anyOf:
            - $ref: '#/components/schemas/VariableExtractionPlan'
            - type: 'null'
        globalNodePlan:
          anyOf:
            - $ref: '#/components/schemas/GlobalNodePlan'
            - type: 'null'
        tool:
          anyOf:
            - $ref: '#/components/schemas/app__controllers__workflows__ToolConfig'
            - type: 'null'
        tool_instances:
          anyOf:
            - items:
                $ref: '#/components/schemas/ToolInstanceAttachment'
              type: array
            - type: 'null'
          title: Tool Instances
        config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Config
      type: object
      required:
        - id
        - type
      title: WorkflowNode
      description: Workflow node model for conversation flows.
    WorkflowEdge:
      properties:
        from:
          anyOf:
            - type: string
            - type: 'null'
          title: From
        to:
          anyOf:
            - type: string
            - type: 'null'
          title: To
        condition:
          anyOf:
            - {}
            - type: 'null'
          title: Condition
          default: always
      type: object
      title: WorkflowEdge
      description: Workflow edge model for flow transitions.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    MessagePlan:
      properties:
        firstMessage:
          anyOf:
            - type: string
            - type: 'null'
          title: Firstmessage
        idleMessages:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Idlemessages
        idleMessageMaxSpokenCount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Idlemessagemaxspokencount
      type: object
      title: MessagePlan
      description: Message plan for first messages.
    VariableExtractionPlan:
      properties:
        output:
          items:
            $ref: '#/components/schemas/VariableExtraction'
          type: array
          title: Output
      type: object
      required:
        - output
      title: VariableExtractionPlan
      description: Variable extraction plan.
    GlobalNodePlan:
      properties:
        enabled:
          type: boolean
          title: Enabled
          default: true
        enterCondition:
          anyOf:
            - type: string
            - type: 'null'
          title: Entercondition
      type: object
      title: GlobalNodePlan
      description: Global node configuration.
    app__controllers__workflows__ToolConfig:
      properties:
        type:
          type: string
          title: Type
        tool_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Key
        function:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Function
        messages:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Messages
        destinations:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Destinations
        parameters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Parameters
      type: object
      required:
        - type
      title: ToolConfig
      description: Tool configuration for tool nodes.
    ToolInstanceAttachment:
      properties:
        instance_name:
          type: string
          maxLength: 120
          minLength: 1
          title: Instance Name
        parameters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Parameters
      type: object
      required:
        - instance_name
      title: ToolInstanceAttachment
      description: |-
        V2: a workflow node's reference to an `agent_tools` instance.

        `instance_name` matches the `agent_tools.instance_name` of the tool the
        runtime should make available at this node. `parameters` are optional
        per-node overrides that the runtime can layer on top of the tool's
        persisted CFG when invoking from this specific node (e.g. force a
        different `goodbye_instructions` for an `end_call` instance only when
        fired from a "Refusal" node).
    VariableExtraction:
      properties:
        title:
          type: string
          title: Title
        type:
          type: string
          title: Type
          default: string
        enum:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Enum
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
      type: object
      required:
        - title
      title: VariableExtraction
      description: Variable extraction schema for conversation nodes.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````