İçeriğe geç
ajan.io

Belgeler menüsü

Bu sayfada

Workflow Run Export API

Analiz ve hata ayıklama için iş akışı çalıştırma ve node execution verilerini JSON olarak dışa aktarın.

İş akışı çalıştırma ve node execution verilerini JSON olarak dışa aktarmak için Workflow Run Export API'yi kullanın. Her satır; run metadata'sı, node durumu ve node'a erişiminiz olduğunda ayrıntılı execution verisi sağlar.

Başlamadan önce

Başlamadan önce şunlara sahip olduğunuzdan emin olun:

  • Workspace API key: Settings > Workspace > Products > API altında WORKFLOW_API kapsamına sahip bir workspace API anahtarı oluşturun. Personal API anahtarları yalnızca Completion API'lerini destekler. Bkz. Personal API keys.
  • Workflow access: API anahtarı bir iş akışı sahibine veya editor'üne ait olmalıdır. Workspace yöneticileri, iş akışı paylaşımı olmadan da iş akışlarına erişebilir. User rolüyle paylaşılan bir iş akışı — workspace yöneticileri dahil — bu endpoint'e erişim vermez.

Bir workspace yöneticisinin API anahtarı, workspace genelinde veri dışa aktarabilir. Yönetici olmayan birinin API anahtarı, yalnızca o kişinin sahip olduğu veya düzenleyebildiği iş akışlarıyla sınırlıdır. Bu kapsamı yalnızca güvenilir kullanıcılara verin.

Base URL

text
    https://api.ajan.io
text
    https:///api/public

Endpoint

http
GET /workflows/{workflowId}/runs

Her node execution için bir satır alırsınız. Node execution'ı olmayan bir run, null node alanlarıyla bir satır döndürür.

Authentication

API anahtarınızı Bearer token olarak gönderin:

bash
curl "https://api.ajan.io/workflows/550e8400-e29b-41d4-a716-446655440000/runs?from=2026-08-01&to=2026-08-31" \
  -H "Authorization: Bearer YOUR_API_KEY"

Dedicated deployment için https://api.ajan.io adresini deployment base URL'nizle değiştirin.

Parameters

ParameterLocationTypeRequiredDescription
workflowIdPathstringYesDışa aktarılacak iş akışının kimliği. Geçerli bir GUID olmalıdır.
fromQuerystringYesRun oluşturma zamanı için dışa aktarım aralığının başlangıcı. ISO 8601 tarih veya zaman damgası kullanın. Yalnızca tarih değeri 00:00:00.000 UTC'de başlar.
toQuerystringYesRun oluşturma zamanı için dışa aktarım aralığının sonu. ISO 8601 tarih veya zaman damgası kullanın. Yalnızca tarih değeri 23:59:59.999 UTC'de biter. Değer from ile eşit veya daha sonra olmalıdır.

Tam zaman damgalarına Z veya açık bir UTC offset ekleyin. Saat dilimi olmayan bir zaman damgası, sunucunun yerel saat diliminde yorumlanır. Her iki tarih değeri de zorunludur. API varsayılan bir tarih aralığı uygulamaz. Eşleşen bir run için her node execution'ı alırsınız — node execution tarih aralığının dışında kalsa bile.

Response

Düzleştirilmiş iş akışı run ve node execution satırlarını içeren bir data dizisi alırsınız:

json
{
  "data": [
    {
      "run_id": "7d2a1c4e-2f6a-4b9f-8c31-1a6d8e4f2b90",
      "run_number": 42,
      "run_status": "COMPLETED",
      "run_created_at": "2026-08-12T09:15:00.000Z",
      "run_updated_at": "2026-08-12T09:15:08.000Z",
      "workflow_version": "3",
      "trigger_mode": "WEBHOOK",
      "node_execution_id": "2b8c1d4e-6f7a-4b90-9c12-3d5e7f8a1b20",
      "node_id": "9c1f2d3e-7a4b-4c58-8d19-2e6f0b7a4c31",
      "node_type": "agent",
      "node_status": "COMPLETED",
      "node_created_at": "2026-08-12T09:15:01.000Z",
      "node_updated_at": "2026-08-12T09:15:06.000Z",
      "failure_code": null,
      "input": {
        "customer_id": "customer-42"
      },
      "input_error": null,
      "output": {
        "category": "support"
      },
      "output_error": null,
      "logs": [],
      "data_redacted": false,
      "execution_data_expired_at": null
    }
  ]
}

Satırlar önce run oluşturma zamanına, ardından node execution oluşturma zamanına göre eskiden yeniye sıralanır. Endpoint sayfalama yapmaz. Yanıt boyutunu küçültmek için daha dar bir tarih aralığı kullanın.

Response fields

FieldTypeDescription
run_idstringİş akışı run kimliği.
run_numbernumberİş akışı içindeki sıralı run numarası.
run_statusstringİş akışı run durumu: PENDING, IN_PROGRESS, AWAITING_INPUT, COMPLETED, FAILED veya CANCELLED.
run_created_atstringİş akışı run'ının ISO 8601 biçiminde oluşturma zamanı.
run_updated_atstringİş akışı run'ının ISO 8601 biçiminde son güncelleme zamanı.
workflow_versionstringRun için kullanılan iş akışı sürümü. Sürüm 0 taslak iş akışı sürümüdür. Public endpoint test veya production filtresi sağlamaz.
trigger_modestring or nullRun'ı tetikleyen mod: WEBHOOK, FORM, SCHEDULED, INTEGRATION_POLLING veya MANUAL.
node_execution_idstring or nullNode execution kimliği.
node_idstring or nullİş akışı node kimliği.
node_typestring or nullİş akışı node türü.
node_statusstring or nullNode execution durumu: NONE, IN_PROGRESS, AWAITING_INPUT, COMPLETED, FAILED veya CANCELLED.
node_created_atstring or nullNode execution'ın ISO 8601 biçiminde oluşturma zamanı.
node_updated_atstring or nullNode execution'ın ISO 8601 biçiminde son güncelleme zamanı.
failure_codestring or nullNode execution başarısız olduğunda failure code.
inputJSON value or nullNode execution için girdi verisi.
input_errorJSON value or nullNode girdisi için hata verisi.
outputJSON value or nullNode execution için çıktı verisi.
output_errorJSON value or nullNode çıktısı için hata verisi.
logsJSON value or nullNode execution sırasında üretilen log'lar.
data_redactedbooleanNode verisine erişemediğiniz veya endpoint erişimi doğrulayamadığı için payload alanlarının atlanıp atlanmadığı.
execution_data_expired_atstring or nullAyrıntılı execution verisinin süresinin dolduğu zaman, ISO 8601 biçiminde.

input ve output alanları, 30 günden eski execution verisi için null'dır. Endpoint node verisine erişimi doğrulayamazsa beş payload alanının tümü null olur. Bu, iş akışı erişiminizin execution'da kullanılan bir action veya agent node'unu kapsamadığı durumlarda olabilir. API bu durumda data_redacted değerini true yapar.

16.000 bayttan büyük payload değerleri için API bir truncation marker döndürür. Marker; originalBytes, maxBytes ve message alanlarını içeren bir _truncated nesnesi barındırır.

Yanıt, bir run'ı tetikleyen kişi veya grubun kimliğini içermez.

Limits and retention

  • Her istek en fazla 10.000 iş akışı run'ı dışa aktarabilir.
  • Girdi ve çıktı verisi 30 gün saklanır.
  • Tek bir yanıttaki payload verisi 8.000.000 bayt ile sınırlıdır.

Bir istek 10.000 run'ı aşarsa WORKFLOW_RUN_EXPORT_LIMIT_EXCEEDED koduyla 400 Bad Request döner. Payload verisi 8.000.000 baytı aşarsa WORKFLOW_RUN_EXPORT_TOO_LARGE koduyla 400 Bad Request döner. Her iki hatayı da çözmek için daha küçük bir tarih aralığı kullanın.

Rate limits

Endpoint, her workspace ve API anahtarı için dakikada 500 isteke izin verir. Limitin üzerindeki istekler 429 Too Many Requests döndürür.

Error handling

Status codeDescription
400İstek geçersiz. Geçersiz iş akışı kimliği veya tarih, from'dan önce bir to değeri, 10.000'den fazla run içeren dışa aktarım veya 8.000.000 bayttan büyük payload verisi dahildir.
401API anahtarı eksik veya geçersiz.
403API anahtarında WORKFLOW_API kapsamı yok veya sahibi iş akışı sahibi, editor ya da workspace yöneticisi değil. İş akışı User rolü — workspace yöneticileri dahil — erişim vermez.
405İstek GET dışında bir yöntem kullanıyor.
429Workspace ve API anahtarı istek rate limit'ini aştı.
500Beklenmeyen bir sunucu hatası oluştu.
json
{
  "message": "Workflow run exports are limited to 10,000 runs. Select a smaller date range.",
  "code": "WORKFLOW_RUN_EXPORT_LIMIT_EXCEEDED",
  "details": {
    "maxRuns": 10000
  }
}

Hatalı biçimlendirilmiş query parametreleri code alanı olmadan {"message":"Invalid request","errors":[...]} döndürür. Geçersiz bir tarih veya from'dan önce bir to değeri code: "BAD_REQUEST" döndürür.

ajan, API anahtarınızı korumak ve uygulamalarınızın güvenliğini sağlamak için tarayıcı kaynaklı istekleri bilinçli olarak engeller. Daha fazla bilgi için API Key Best Practices kılavuzuna bakın.

OpenAPI

openapi: 3.0.0
info:
  title: ajan API
  version: 3.0.0
servers:
  - url: https://api.ajan.io
    description: Production
security:
  - bearerAuth: []
paths:
  /workflows/{workflowId}/runs:
    get:
      tags:
        - Workflow Run Export
      summary: Export workflow run data
      description: |
        Returns flattened workflow run and node execution rows for the selected
        workflow. The date range filters workflow run creation time. The
        endpoint requires a workspace API key with the `WORKFLOW_API` scope and
        owner or editor access. Workspace administrators can access workflows
        without a workflow share, but a User share does not grant access.
      operationId: exportWorkflowRunData
      parameters:
        - name: workflowId
          in: path
          required: true
          description: ID of the workflow to export.
          schema:
            type: string
            format: uuid
        - name: from
          in: query
          required: true
          description: |
            Start of the export range. Use an ISO 8601 date or timestamp. A
            date-only value starts at 00:00:00.000 UTC.
          schema:
            type: string
          example: '2026-08-01'
        - name: to
          in: query
          required: true
          description: |
            End of the export range. Use an ISO 8601 date or timestamp. A
            date-only value ends at 23:59:59.999 UTC.
          schema:
            type: string
          example: '2026-08-31'
      responses:
        '200':
          description: Workflow run export
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowRunExportResponse'
              example:
                data:
                  - run_id: 7d2a1c4e-2f6a-4b9f-8c31-1a6d8e4f2b90
                    run_number: 42
                    run_status: COMPLETED
                    run_created_at: '2026-08-12T09:15:00.000Z'
                    run_updated_at: '2026-08-12T09:15:08.000Z'
                    workflow_version: '3'
                    trigger_mode: WEBHOOK
                    node_execution_id: 2b8c1d4e-6f7a-4b90-9c12-3d5e7f8a1b20
                    node_id: 9c1f2d3e-7a4b-4c58-8d19-2e6f0b7a4c31
                    node_type: agent
                    node_status: COMPLETED
                    node_created_at: '2026-08-12T09:15:01.000Z'
                    node_updated_at: '2026-08-12T09:15:06.000Z'
                    failure_code: null
                    input:
                      customer_id: customer-42
                    input_error: null
                    output:
                      category: support
                    output_error: null
                    logs: []
                    data_redacted: false
                    execution_data_expired_at: null
        '400':
          description: Invalid request or export exceeds a configured limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowRunExportError'
              example:
                message: >-
                  Workflow run exports are limited to 10,000 runs. Select a
                  smaller date range.
                code: WORKFLOW_RUN_EXPORT_LIMIT_EXCEEDED
                details:
                  maxRuns: 10000
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowRunExportError'
        '403':
          description: Missing scope or workflow access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowRunExportError'
        '405':
          description: Method not allowed
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowRunExportError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowRunExportError'
      security:
        - bearerAuth: []
components:
  schemas:
    WorkflowRunExportResponse:
      type: object
      description: Flattened workflow run and node execution rows.
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/WorkflowRunExportRow'
    WorkflowRunExportError:
      type: object
      description: Error response from the Workflow Run Export API.
      properties:
        message:
          type: string
          description: Error message.
        code:
          type: string
          description: Machine-readable error code, when available.
        details:
          type: object
          additionalProperties: true
          description: Additional error context, when available.
        errors:
          type: array
          items:
            type: object
            additionalProperties: true
          description: Validation details for malformed query parameters.
      required:
        - message
    WorkflowRunExportRow:
      type: object
      description: Data for one workflow run and its node execution.
      required:
        - run_id
        - run_number
        - run_status
        - run_created_at
        - run_updated_at
        - workflow_version
        - trigger_mode
        - node_execution_id
        - node_id
        - node_type
        - node_status
        - node_created_at
        - node_updated_at
        - failure_code
        - input
        - input_error
        - output
        - output_error
        - logs
        - data_redacted
        - execution_data_expired_at
      properties:
        run_id:
          type: string
          format: uuid
          description: ID of the workflow run.
        run_number:
          type: integer
          description: Sequential number of the run within the workflow.
        run_status:
          type: string
          enum:
            - PENDING
            - IN_PROGRESS
            - AWAITING_INPUT
            - COMPLETED
            - FAILED
            - CANCELLED
          description: Status of the workflow run.
        run_created_at:
          type: string
          format: date-time
          description: Creation time of the workflow run.
        run_updated_at:
          type: string
          format: date-time
          description: Last update time of the workflow run.
        workflow_version:
          type: string
          description: Version of the workflow used for the run.
        trigger_mode:
          type: string
          nullable: true
          enum:
            - WEBHOOK
            - FORM
            - SCHEDULED
            - INTEGRATION_POLLING
            - MANUAL
          description: Mode that triggered the run.
        node_execution_id:
          type: string
          format: uuid
          nullable: true
          description: ID of the node execution.
        node_id:
          type: string
          format: uuid
          nullable: true
          description: ID of the workflow node.
        node_type:
          type: string
          nullable: true
          description: Type of the workflow node.
        node_status:
          type: string
          nullable: true
          enum:
            - NONE
            - IN_PROGRESS
            - AWAITING_INPUT
            - COMPLETED
            - FAILED
            - CANCELLED
          description: Status of the node execution.
        node_created_at:
          type: string
          format: date-time
          nullable: true
          description: Creation time of the node execution.
        node_updated_at:
          type: string
          format: date-time
          nullable: true
          description: Last update time of the node execution.
        failure_code:
          type: string
          nullable: true
          description: Failure code when the node execution fails.
        input:
          nullable: true
          description: Input data for the node execution.
          oneOf:
            - type: object
              additionalProperties: true
            - type: array
              items: {}
            - type: string
            - type: number
            - type: boolean
        input_error:
          nullable: true
          description: Error data for the node input.
          oneOf:
            - type: object
              additionalProperties: true
            - type: array
              items: {}
            - type: string
            - type: number
            - type: boolean
        output:
          nullable: true
          description: Output data for the node execution.
          oneOf:
            - type: object
              additionalProperties: true
            - type: array
              items: {}
            - type: string
            - type: number
            - type: boolean
        output_error:
          nullable: true
          description: Error data for the node output.
          oneOf:
            - type: object
              additionalProperties: true
            - type: array
              items: {}
            - type: string
            - type: number
            - type: boolean
        logs:
          nullable: true
          description: Logs generated during the node execution.
          oneOf:
            - type: object
              additionalProperties: true
            - type: array
              items: {}
            - type: string
            - type: number
            - type: boolean
        data_redacted:
          type: boolean
          description: >-
            Whether payload fields were omitted because access to the node data
            could not be established.
        execution_data_expired_at:
          type: string
          format: date-time
          nullable: true
          description: Time when detailed execution data expired.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key as Bearer token. Format "Bearer YOUR_API_KEY"