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

# Create Workflow

> Create a new workflow and configure its parameters.



## OpenAPI

````yaml POST /workflow
openapi: 3.0.1
info:
  title: Machina Sports SDK
  description: >-
    Machina Sports API for seamless AI integration in sports, offering real-time
    insights, personalized content, and fan sentiment analysis.
  version: '1.0'
  termsOfService: http://machina.gg/tos/
  contact:
    email: support@machina.gg
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://{api-address}.org.machina.gg
    description: Production server
    variables:
      api-address:
        default: https://api.machina.gg
        description: Your api-address
  - url: http://local.machina:5001
    description: Local development server
security:
  - ApiToken: []
paths:
  /workflow:
    post:
      tags:
        - workflows
      summary: Create Workflow
      description: Create a new workflow and configure its parameters.
      operationId: createWorkflow
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - title
                - description
              properties:
                name:
                  type: string
                  description: Unique identifier for the workflow
                title:
                  type: string
                  description: Display title of the workflow
                description:
                  type: string
                  description: Detailed description of the workflow's purpose
                context-variables:
                  type: object
                  description: Configuration settings and API keys for the workflow
                inputs:
                  type: object
                  description: >-
                    Input parameters for the workflow with default values or
                    expressions
                outputs:
                  type: object
                  description: Output mappings for the workflow using expressions
                  required:
                    - workflow-status
                  properties:
                    workflow-status:
                      type: string
                      description: >-
                        Expression that evaluates to 'executed', 'skipped', or
                        'failed'
                      example: >-
                        $.get('event_exists') is not True and 'skipped' or
                        'executed'
                tasks:
                  type: array
                  description: Array of task definitions that make up the workflow
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        description: >-
                          Type of task (connector, document, ai, transform,
                          condition)
                        enum:
                          - connector
                          - document
                          - ai
                          - transform
                          - condition
                      name:
                        type: string
                        description: Name of the task
                      description:
                        type: string
                        description: Description of the task's purpose
                      condition:
                        type: string
                        description: Condition for task execution (optional)
                      inputs:
                        type: object
                        description: Input mappings for the task
                      outputs:
                        type: object
                        description: Output mappings for the task
                status:
                  type: string
                  enum:
                    - active
                    - inactive
                  default: active
                  description: Current status of the workflow
      responses:
        '201':
          description: Workflow created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      _id:
                        type: string
                        description: Unique identifier of the created workflow
                  status:
                    type: boolean
                    description: Operation status
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized
components:
  securitySchemes:
    ApiToken:
      type: apiKey
      name: x-api-token
      in: header
      description: API key authentication

````