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

# Update workflow

> Updates an existing workflow.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/triglit/openapi.documented.yml patch /v1/gateway/workflows/{workflowId}
openapi: 3.0.0
info:
  title: Triglit
  description: Documentação da API do Triglit
  version: '1.0'
  contact: {}
servers: []
security: []
tags: []
paths:
  /v1/gateway/workflows/{workflowId}:
    patch:
      tags:
        - Workflows
      summary: Update workflow
      description: Updates an existing workflow.
      operationId: publicworkflows_updateWorkflow_v1
      parameters:
        - name: workflowId
          required: true
          in: path
          description: Workflow identifier
          schema:
            example: wf_abc123def456
            type: string
        - name: X-API-Key
          in: header
          description: Chave de API do tenant (publishable key ou secret key)
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWorkflowDto'
      responses:
        '200':
          description: Workflow updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowResponseDto'
        '401':
          description: API key não fornecida, inválida ou não encontrada.
        '403':
          description: Tipo de chave não permitido para este endpoint.
        '404':
          description: Workflow not found
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Triglit from 'triglit';

            const client = new Triglit({
              apiKey: 'My API Key',
            });

            const workflow = await client.workflows.update('wf_abc123def456');

            console.log(workflow.id);
components:
  schemas:
    UpdateWorkflowDto:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
        description:
          type: string
          maxLength: 1000
    WorkflowResponseDto:
      type: object
      properties:
        id:
          type: string
          description: Unique workflow identifier
          example: wf_abc123def456
        tenantId:
          type: string
          description: Tenant identifier
          example: tenant_123
        subTenantId:
          type: string
          description: Sub-tenant identifier
          example: sub_tenant_456
        name:
          type: string
          description: Workflow name
          example: User Onboarding Workflow
        description:
          type: string
          description: Workflow description
          example: Automated workflow for new user onboarding
        isActive:
          type: boolean
          description: Whether the workflow is active
          example: true
        createdAt:
          type: string
          description: Creation timestamp
          example: '2024-01-15T10:30:00.000Z'
        updatedAt:
          type: string
          description: Last update timestamp
          example: '2024-01-15T10:30:00.000Z'
      required:
        - id
        - tenantId
        - name
        - isActive
        - createdAt
        - updatedAt
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Chave de API do tenant (publishable key ou secret key)

````