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

# Update Workflow

> Update a workflow definition.



## OpenAPI

````yaml put /api/v1/workflows/{workflow_id}
openapi: 3.1.0
info:
  title: SnackBase
  description: Open-source Backend-as-a-Service (BaaS)
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/workflows/{workflow_id}:
    put:
      tags:
        - workflows
        - Workflows
      summary: Update Workflow
      description: Update a workflow definition.
      operationId: update_workflow_api_v1_workflows__workflow_id__put
      parameters:
        - name: workflow_id
          in: path
          required: true
          schema:
            type: string
            title: Workflow Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowUpdateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    WorkflowUpdateRequest:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 200
              minLength: 1
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        trigger:
          anyOf:
            - oneOf:
                - $ref: >-
                    #/components/schemas/snackbase__infrastructure__api__schemas__workflow_schemas__EventTriggerConfig
                - $ref: >-
                    #/components/schemas/snackbase__infrastructure__api__schemas__workflow_schemas__ScheduleTriggerConfig
                - $ref: >-
                    #/components/schemas/snackbase__infrastructure__api__schemas__workflow_schemas__ManualTriggerConfig
                - $ref: '#/components/schemas/WebhookTriggerConfig'
              discriminator:
                propertyName: type
                mapping:
                  event:
                    $ref: >-
                      #/components/schemas/snackbase__infrastructure__api__schemas__workflow_schemas__EventTriggerConfig
                  manual:
                    $ref: >-
                      #/components/schemas/snackbase__infrastructure__api__schemas__workflow_schemas__ManualTriggerConfig
                  schedule:
                    $ref: >-
                      #/components/schemas/snackbase__infrastructure__api__schemas__workflow_schemas__ScheduleTriggerConfig
                  webhook:
                    $ref: '#/components/schemas/WebhookTriggerConfig'
            - type: 'null'
          title: Trigger
        steps:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Steps
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Enabled
      type: object
      title: WorkflowUpdateRequest
    WorkflowResponse:
      properties:
        id:
          type: string
          title: Id
        account_id:
          type: string
          title: Account Id
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        trigger_type:
          type: string
          title: Trigger Type
        trigger_config:
          additionalProperties: true
          type: object
          title: Trigger Config
        steps:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Steps
        enabled:
          type: boolean
          title: Enabled
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
      type: object
      required:
        - id
        - account_id
        - name
        - description
        - trigger_type
        - trigger_config
        - steps
        - enabled
        - created_at
        - updated_at
        - created_by
      title: WorkflowResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    snackbase__infrastructure__api__schemas__workflow_schemas__EventTriggerConfig:
      properties:
        type:
          type: string
          const: event
          title: Type
        event:
          type: string
          title: Event
          description: Event name, e.g. 'records.create'
        collection:
          anyOf:
            - type: string
            - type: 'null'
          title: Collection
          description: Restrict to a specific collection
        condition:
          anyOf:
            - type: string
            - type: 'null'
          title: Condition
          description: Optional filter expression
      type: object
      required:
        - type
        - event
      title: EventTriggerConfig
    snackbase__infrastructure__api__schemas__workflow_schemas__ScheduleTriggerConfig:
      properties:
        type:
          type: string
          const: schedule
          title: Type
        cron:
          type: string
          title: Cron
          description: 5-field cron expression, e.g. '0 9 * * MON'
      type: object
      required:
        - type
        - cron
      title: ScheduleTriggerConfig
    snackbase__infrastructure__api__schemas__workflow_schemas__ManualTriggerConfig:
      properties:
        type:
          type: string
          const: manual
          title: Type
      type: object
      required:
        - type
      title: ManualTriggerConfig
    WebhookTriggerConfig:
      properties:
        type:
          type: string
          const: webhook
          title: Type
        token:
          anyOf:
            - type: string
            - type: 'null'
          title: Token
          description: Server-generated webhook token (read-only)
      type: object
      required:
        - type
      title: WebhookTriggerConfig
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````