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

# Get Workflow Lead History

> Fetch the node-by-node execution history for one workflow lead.

Read only
Returns the history of a single lead's path through the workflow, oldest transition first. Entries whose destination node has since been deleted are left out. Each `history` entry records one move between nodes: `from_node` (null for the first entry, or when that node has been deleted) and `to_node` (each with `id`, `label`, `node_type` and `config`), the `transition_reason`, `transitioned_at`, and `metadata`. When the lead left a `VOICE_CALL` node, `metadata` carries the matching `call_id` and `call_status` so you can pivot into [Get Call Details](https://dialnexa.com/docs/api-reference/v1/calls/get.md) to inspect the transcript. IDs inside the history (entry, node and `call_id`) are raw, without a prefix; Get Call Details accepts a raw call ID.

The response also contains:

* `lead`: the lead's `id` (`lead_...`), `phone_number`, `dynamic_variables` (an array of `key` and `value` pairs) and `notes`.
* `execution`: the lead's current execution (`id`, `current_node_id`, `status` and `entry_time`), or null if the lead has not started. A lead stopped because its number is on the workspace's DNC list has `status` `dnc_blocked`, and its last history entry has `transition_reason` `Stopped: number is on the DNC list`.
* `all_nodes` and `all_edges`: every node and edge in the workflow, so you can draw the full graph around the lead's path.

Use this endpoint for per-lead debugging, quality review, and rendering a timeline view in your dashboard. A removed lead's history stays readable.

## When to use this

* **Debugging a stuck lead**: confirm which node the lead is waiting on (`execution.current_node_id`) and how long it has been there.
* **Quality review**: produce a per-lead timeline for compliance or operations reviewers.
* **Drill-down from a dashboard**: pivot from a workflow lead row into the full path the lead took.
* **Reporting on path coverage**: sample lead histories to confirm conditional branches are being followed as expected.

For aggregate lead progress across the workflow, use [List Workflow Leads](https://dialnexa.com/docs/api-reference/v1/workflow-leads/list.md). For the call record of a specific voice-call step, use the `call_id` returned by this endpoint with [Get Call Details](https://dialnexa.com/docs/api-reference/v1/calls/get.md).

## Path parameters

| Parameter | Description |
| - | - |
| `workflowId` | The workflow ID, for example `workflow_m3v7zb9rk2px4q`. |
| `id` | The workflow lead ID, for example `lead_p3q8zv5bk2mx7d`. |

## Errors

* `404 Not Found` is returned when the workflow or lead does not exist, or the lead is not enrolled in the workflow.

## Related endpoints

* [List Workflow Leads](https://dialnexa.com/docs/api-reference/v1/workflow-leads/list.md): see every lead in the workflow.
* [Get Call Details](https://dialnexa.com/docs/api-reference/v1/calls/get.md): full transcript for the `call_id` returned above.
* [Get Workflow Details](https://dialnexa.com/docs/api-reference/v1/workflows/get.md): workflow summary alongside per-lead drill-downs.
* [Call nodes](https://dialnexa.com/docs/workflows/call-nodes.md): understand the voice-call steps referenced in the history.


## OpenAPI

````yaml GET /v1/workflows/{workflowId}/leads/{id}/history
openapi: 3.0.0
info:
  title: DialNexa API
  description: Public `/v1` REST API for the DialNexa voice AI platform.
  version: 1.0.0
servers:
  - url: https://api.dialnexa.com
    description: DialNexa production API
security:
  - bearer: []
tags:
  - name: Agents
  - name: Batch Calls
  - name: Calls
  - name: Knowledge Base
  - name: Languages
  - name: LLMs
  - name: Phone Numbers
  - name: Organization Folders
  - name: Transcribers
  - name: Webhooks
  - name: Voices
  - name: Workflows
  - name: Workflow Leads
  - name: Authentication
  - name: Agent Builder
  - name: Agent Evaluations
paths:
  /v1/workflows/{workflowId}/leads/{id}/history:
    get:
      tags:
        - Workflow Leads
      summary: Get Lead Execution History
      description: Returns node-by-node execution history for one workflow lead.
      operationId: getWorkflowLeadHistory
      parameters:
        - name: workflowId
          required: true
          in: path
          description: Workflow ID
          schema:
            type: string
            example: workflow_abc123
        - name: id
          required: true
          in: path
          description: Lead ID
          schema:
            type: string
            example: lead_abc123
      responses:
        '200':
          description: Lead execution history returned successfully.
          content:
            application/json:
              examples:
                success:
                  summary: Successful response
                  value:
                    success: true
                    error: false
                    statusCode: 200
                    message: Success
                    data:
                      statusCode: 200
                      message: Lead history fetched successfully
                      data:
                        lead:
                          id: lead_abc123
                          phone_number: '+919876543210'
                          dynamic_variables:
                            - key: customer_name
                              value: Priya Sharma
                            - key: loan_amount
                              value: '500000'
                          notes: null
                        execution:
                          id: Ex8nT4vQ1mLz6c
                          current_node_id: Wq3mK7pL9xNz2b
                          status: completed
                          entry_time: '2026-07-03T10:31:00.000Z'
                        history:
                          - id: Hs2kP9wQ4nLx7v
                            from_node: null
                            to_node:
                              id: Rt5vN8kQ2wLz7x
                              label: First call
                              node_type: VOICE_CALL
                              config:
                                phone_number_id: phn_abc123
                            transition_reason: Entered workflow at entry node
                            metadata: {}
                            transitioned_at: '2026-07-03T10:31:00.000Z'
                          - id: Hs5mR3tY8bKw1q
                            from_node:
                              id: Rt5vN8kQ2wLz7x
                              label: First call
                              node_type: VOICE_CALL
                              config:
                                phone_number_id: phn_abc123
                            to_node:
                              id: Wq3mK7pL9xNz2b
                              label: Converted
                              node_type: CONVERTED
                              config: {}
                            transition_reason: 'Call COMPLETED: completed'
                            metadata:
                              call_id: Cl7vB2nM5xQz9k
                              call_status: completed
                            transitioned_at: '2026-07-03T10:36:10.000Z'
                          - id: Hs8tW1nB6vQz3m
                            from_node:
                              id: Wq3mK7pL9xNz2b
                              label: Converted
                              node_type: CONVERTED
                              config: {}
                            to_node:
                              id: Wq3mK7pL9xNz2b
                              label: Converted
                              node_type: CONVERTED
                              config: {}
                            transition_reason: Reached CONVERTED terminal node
                            metadata: {}
                            transitioned_at: '2026-07-03T10:36:10.000Z'
                        all_nodes:
                          - id: Rt5vN8kQ2wLz7x
                            label: First call
                            node_type: VOICE_CALL
                            config:
                              phone_number_id: phn_abc123
                              phone_number_display: '+919876500000'
                            position_x: 100
                            position_y: 100
                          - id: Wq3mK7pL9xNz2b
                            label: Converted
                            node_type: CONVERTED
                            config: {}
                            position_x: 400
                            position_y: 100
                        all_edges:
                          - id: Ed4jH6kL2mNp8r
                            from_node_id: Rt5vN8kQ2wLz7x
                            to_node_id: Wq3mK7pL9xNz2b
                            label: COMPLETED
                    timestamp: '2026-09-07T06:00:00.000Z'
              schema:
                type: object
                required:
                  - success
                  - error
                  - statusCode
                  - message
                  - data
                  - timestamp
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  error:
                    type: boolean
                    enum:
                      - false
                  statusCode:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: Success
                  data:
                    type: object
                    properties:
                      statusCode:
                        type: number
                        example: 200
                      message:
                        type: string
                        example: Lead history fetched successfully
                      data:
                        type: object
                        properties:
                          lead:
                            type: object
                            properties:
                              id:
                                type: string
                                example: lead_abc123
                              phone_number:
                                type: string
                              dynamic_variables:
                                type: array
                                description: >-
                                  One entry per non-empty data cell of the
                                  uploaded file. Blank cells add no entry;
                                  values are trimmed and inner whitespace is
                                  collapsed.
                                items:
                                  type: object
                                  properties:
                                    key:
                                      type: string
                                      example: customer_name
                                    value:
                                      type: string
                                      example: Priya Sharma
                                    fallback:
                                      type: string
                                  required:
                                    - key
                                    - value
                              notes:
                                type: object
                                nullable: true
                                description: >-
                                  The reserved notes column: a JSON object of at
                                  most 15 keys, or plain text stored as {"text":
                                  "<cell>"}.
                          execution:
                            type: object
                            nullable: true
                            properties:
                              id:
                                type: string
                              current_node_id:
                                type: string
                              status:
                                type: string
                                enum:
                                  - active
                                  - completed
                                  - dropped
                                  - failed
                                  - dnc_blocked
                              entry_time:
                                type: string
                                format: date-time
                          history:
                            type: array
                            description: >-
                              Transitions, oldest first. IDs are raw, without
                              prefixes.
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                from_node:
                                  type: object
                                  nullable: true
                                  properties:
                                    id:
                                      type: string
                                    label:
                                      type: string
                                    node_type:
                                      type: string
                                      enum:
                                        - VOICE_CALL
                                        - CONDITIONAL
                                        - TIME
                                        - APPLICATION
                                        - CUSTOM_FUNCTION
                                        - CONVERTED
                                        - DROPPED
                                    config:
                                      type: object
                                to_node:
                                  type: object
                                  nullable: true
                                  properties:
                                    id:
                                      type: string
                                    label:
                                      type: string
                                    node_type:
                                      type: string
                                      enum:
                                        - VOICE_CALL
                                        - CONDITIONAL
                                        - TIME
                                        - APPLICATION
                                        - CUSTOM_FUNCTION
                                        - CONVERTED
                                        - DROPPED
                                    config:
                                      type: object
                                transition_reason:
                                  type: string
                                metadata:
                                  type: object
                                  description: >-
                                    After a Voice Call node: call_id (raw call
                                    ID) and call_status.
                                transitioned_at:
                                  type: string
                                  format: date-time
                          all_nodes:
                            type: array
                            description: >-
                              Every node in the workflow. Voice Call node config
                              also carries phone_number_display.
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                label:
                                  type: string
                                node_type:
                                  type: string
                                config:
                                  type: object
                                position_x:
                                  type: number
                                position_y:
                                  type: number
                          all_edges:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                from_node_id:
                                  type: string
                                to_node_id:
                                  type: string
                                label:
                                  type: string
                  timestamp:
                    type: string
                    format: date-time
        '401':
          description: Unauthorized - missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  summary: 401 Unauthorized
                  value:
                    statusCode: 401
                    error: true
                    success: false
                    data: []
                    message: Invalid API key
                    errors: []
        '404':
          description: Lead not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  summary: 404 Not Found
                  value:
                    statusCode: 404
                    error: true
                    success: false
                    data: []
                    message: Lead Bv7nC2xKs5DqYw not found in workflow Hk3pW9zQe1LmRt
                    errors: []
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  summary: 500 Internal Server Error
                  value:
                    statusCode: 500
                    error: true
                    success: false
                    data: []
                    message: Internal server error
                    errors: []
      security:
        - bearer: []
components:
  schemas:
    ErrorResponse:
      type: object
      description: Error body on endpoints without response filtering.
      properties:
        statusCode:
          type: integer
          example: 404
        error:
          type: boolean
          enum:
            - true
        success:
          type: boolean
          enum:
            - false
        data:
          oneOf:
            - type: object
              properties:
                code:
                  type: string
                  description: Machine-readable refusal code.
            - type: array
              items: {}
          description: >-
            For a coded refusal, an object with code and the details listed for
            that code. Otherwise an empty array.
        message:
          type: string
        errors:
          type: array
          items:
            type: string
          description: Validation messages for a 400. Empty for other errors.
        validation_errors:
          type: array
          description: >-
            Present when uploaded rows fail number validation (batch and
            workflow lead uploads): one group per distinct error.
          items:
            type: object
            properties:
              error:
                type: string
              rows:
                type: array
                items:
                  type: integer
                description: Row numbers with this error.
              phone_numbers:
                type: array
                items:
                  type: string
        invalid_row_count:
          type: integer
          description: 'Present with validation_errors: how many rows failed.'
      required:
        - statusCode
        - error
        - success
        - data
        - message
        - errors
  securitySchemes:
    bearer:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.