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

# Put v1businesses workflows



## OpenAPI

````yaml /api-reference/openapi.json put /v1/businesses/{businessId}/workflows/{id}
openapi: 3.0.4
info:
  title: Smartbills.API
  version: v1
servers:
  - url: https://api.smartbills.io
    description: Production
security: []
paths:
  /v1/businesses/{businessId}/workflows/{id}:
    put:
      tags:
        - Workflow
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: businessId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModelsWorkflowsWorkflow'
          text/json:
            schema:
              $ref: '#/components/schemas/ModelsWorkflowsWorkflow'
          application/*+json:
            schema:
              $ref: '#/components/schemas/ModelsWorkflowsWorkflow'
      responses:
        '200':
          description: OK
components:
  schemas:
    ModelsWorkflowsWorkflow:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        entityType:
          type: string
          nullable: true
        priority:
          type: integer
          format: int32
        enabled:
          type: boolean
        effectiveFrom:
          type: string
          format: date-time
          nullable: true
        effectiveTo:
          type: string
          format: date-time
          nullable: true
        tags:
          type: string
          nullable: true
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/ModelsWorkflowsConditionsIWorkflowCondition'
          nullable: true
        actions:
          type: array
          items:
            $ref: '#/components/schemas/ModelsWorkflowsActionsSBWorkflowAction'
          nullable: true
        triggers:
          type: array
          items:
            $ref: '#/components/schemas/ModelsWorkflowsWorkflowTrigger'
          nullable: true
        steps:
          type: array
          items:
            $ref: '#/components/schemas/ModelsWorkflowsWorkflowStep'
          nullable: true
        jsonConfig:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
          nullable: true
        businessId:
          type: integer
          format: int64
        createdByUserId:
          type: integer
          format: int64
          nullable: true
      additionalProperties: false
    ModelsWorkflowsConditionsIWorkflowCondition:
      type: object
      additionalProperties: false
    ModelsWorkflowsActionsSBWorkflowAction:
      type: object
      properties:
        id:
          type: integer
          format: int64
        order:
          type: integer
          format: int32
        actionType:
          $ref: '#/components/schemas/ModelsWorkflowsActionsWorkflowActionType'
      additionalProperties: false
    ModelsWorkflowsWorkflowTrigger:
      type: object
      properties:
        id:
          type: string
          format: uuid
        type:
          $ref: '#/components/schemas/ModelsWorkflowsWorkflowTriggerType'
        eventType:
          type: string
          nullable: true
        scheduleExpression:
          type: string
          nullable: true
        eventPattern:
          type: string
          nullable: true
        enabled:
          type: boolean
        configuration:
          type: object
          additionalProperties:
            nullable: true
          nullable: true
      additionalProperties: false
    ModelsWorkflowsWorkflowStep:
      type: object
      properties:
        id:
          type: string
          format: uuid
        workflowId:
          type: string
          format: uuid
        name:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        order:
          type: integer
          format: int32
        type:
          $ref: '#/components/schemas/ModelsWorkflowsWorkflowStepType'
        isRequired:
          type: boolean
        timeoutMinutes:
          type: integer
          format: int32
        maxRetryAttempts:
          type: integer
          format: int32
        retryDelaySeconds:
          type: integer
          format: int32
        dependsOnSteps:
          type: array
          items:
            type: string
            format: uuid
          nullable: true
        successConditions:
          type: array
          items:
            $ref: '#/components/schemas/ModelsWorkflowsConditionsIWorkflowCondition'
          nullable: true
        failureConditions:
          type: array
          items:
            $ref: '#/components/schemas/ModelsWorkflowsConditionsIWorkflowCondition'
          nullable: true
        preConditions:
          type: array
          items:
            $ref: '#/components/schemas/ModelsWorkflowsConditionsIWorkflowCondition'
          nullable: true
        actions:
          type: array
          items:
            $ref: '#/components/schemas/ModelsWorkflowsActionsSBWorkflowAction'
          nullable: true
        eventExpectations:
          type: array
          items:
            $ref: '#/components/schemas/ModelsWorkflowsWorkflowStepEventExpectation'
          nullable: true
        onSuccess:
          $ref: '#/components/schemas/ModelsWorkflowsWorkflowStepBranching'
        onFailure:
          $ref: '#/components/schemas/ModelsWorkflowsWorkflowStepBranching'
        onTimeout:
          $ref: '#/components/schemas/ModelsWorkflowsWorkflowStepBranching'
        configuration:
          type: object
          additionalProperties: {}
          nullable: true
        isActive:
          type: boolean
        timers:
          type: array
          items:
            $ref: '#/components/schemas/ModelsWorkflowsWorkflowStepTimer'
          nullable: true
        canRunInParallel:
          type: boolean
        priority:
          type: integer
          format: int32
        tags:
          type: array
          items:
            type: string
          nullable: true
      additionalProperties: false
    ModelsWorkflowsActionsWorkflowActionType:
      enum:
        - APPROVE
        - REJECT
        - BLOCK
        - FLAG
        - SET_CATEGORY
        - EMAIL_NOTIFICATION
        - NOTIFICATION
        - WEBHOOK
        - ESCALATE
        - REQUIRE_APPROVAL
        - FLAG_LINE_ITEM
      type: string
    ModelsWorkflowsWorkflowTriggerType:
      enum:
        - EVENT
        - SCHEDULE
        - MANUAL
      type: string
    ModelsWorkflowsWorkflowStepType:
      enum:
        - ACTION
        - APPROVAL
        - NOTIFICATION
        - WAIT
        - DECISION
        - INTEGRATION
        - VALIDATION
      type: string
    ModelsWorkflowsWorkflowStepEventExpectation:
      type: object
      properties:
        eventType:
          type: string
          nullable: true
        eventPattern:
          type: string
          nullable: true
        timeoutMinutes:
          type: integer
          format: int32
        isRequired:
          type: boolean
        expectedPayload:
          type: object
          additionalProperties: {}
          nullable: true
      additionalProperties: false
    ModelsWorkflowsWorkflowStepBranching:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/ModelsWorkflowsWorkflowBranchingType'
        nextStepId:
          type: string
          format: uuid
          nullable: true
        nextStepName:
          type: string
          nullable: true
        conditionalBranches:
          type: array
          items:
            $ref: '#/components/schemas/ModelsWorkflowsWorkflowConditionalBranch'
          nullable: true
        stopWorkflow:
          type: boolean
        stopReason:
          type: string
          nullable: true
      additionalProperties: false
    ModelsWorkflowsWorkflowStepTimer:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          nullable: true
        delayMinutes:
          type: integer
          format: int32
        type:
          $ref: '#/components/schemas/ModelsWorkflowsWorkflowTimerType'
        actions:
          type: array
          items:
            $ref: '#/components/schemas/ModelsWorkflowsActionsSBWorkflowAction'
          nullable: true
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/ModelsWorkflowsConditionsIWorkflowCondition'
          nullable: true
        isRecurring:
          type: boolean
        maxRecurrences:
          type: integer
          format: int32
          nullable: true
        isActive:
          type: boolean
      additionalProperties: false
    ModelsWorkflowsWorkflowBranchingType:
      enum:
        - NEXT_STEP
        - CONDITIONAL_BRANCHING
        - STOP_WORKFLOW
        - JUMP_TO_STEP
      type: string
    ModelsWorkflowsWorkflowConditionalBranch:
      type: object
      properties:
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/ModelsWorkflowsConditionsIWorkflowCondition'
          nullable: true
        nextStepId:
          type: string
          format: uuid
        nextStepName:
          type: string
          nullable: true
      additionalProperties: false
    ModelsWorkflowsWorkflowTimerType:
      enum:
        - DELAY
        - TIMEOUT
        - REMINDER
        - ESCALATION
      type: string

````