> ## 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.

# List workflows

> Retrieves a paginated list of workflows for the tenant. Accepts both public and secret keys.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/triglit/openapi.documented.yml get /v1/gateway/workflows
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:
    get:
      tags:
        - Workflows
      summary: List workflows
      description: >-
        Retrieves a paginated list of workflows for the tenant. Accepts both
        public and secret keys.
      operationId: publicworkflows_listWorkflows_v1
      parameters:
        - name: subTenantId
          required: false
          in: query
          description: Sub-tenant identifier
          schema:
            type: string
        - name: isActive
          required: false
          in: query
          description: Whether the workflows should be active
          schema:
            type: boolean
        - name: search
          required: false
          in: query
          description: Search term to filter workflows
          schema:
            type: string
        - name: pageSize
          required: false
          in: query
          description: Number of workflows per page
          schema:
            example: 20
            type: number
        - name: page
          required: false
          in: query
          description: Page number (zero-based)
          schema:
            example: 0
            type: number
        - name: X-API-Key
          in: header
          description: Chave de API do tenant (publishable key ou secret key)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Workflows retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowListResponseDto'
        '401':
          description: API key não fornecida, inválida ou não encontrada.
        '403':
          description: Tipo de chave não permitido para este endpoint.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Triglit from 'triglit';

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

            // Automatically fetches more pages as needed.
            for await (const workflow of client.workflows.list()) {
              console.log(workflow.id);
            }
components:
  schemas:
    WorkflowListResponseDto:
      type: object
      properties:
        data:
          description: List of workflows
          type: array
          items:
            $ref: '#/components/schemas/WorkflowResponseDto'
        page:
          type: number
          description: Current page number (zero-based)
          example: 0
        lastPage:
          type: number
          description: Last page number available (zero-based)
          example: 2
      required:
        - data
        - page
        - lastPage
    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)

````