Get Data from Executions

Get Data from an Execution

It is possible to view and extract data that exists inside an execution in several ways. The purpose of this is to interact with your Paradym workflow from your own system or application.

Using the API

In your solution, you will most likely want to extract data from a Paradym execution using the API. Using the API to retrieve data is very useful when workflows are executed through the API, or when a webhook event was triggered for an execution. You need an API Key to interact with the Paradym API.

To retrieve an execution with the API, make a GET request and provide API key as the value for the x-access-token header.

GET https://api.paradym.id/v1/projects/<project_id>/executions/<workflowExecutionId>

Example Response:

{
  "id": "cllxhxrud0007pjkrdjua1tdn",
  "workflowId": "cllxhk5x60001pj01gnaa3mu3",
  "status": "completed",
  "payload": {
    "input": {
      // execution input values
    },
    "actions": {
      "<id>": {
        "output": {
          // output values of action
        }
      }
    }
  },
  "completedActionIds": ["<id>"],
  "createdAt": "2023-08-30T08:49:48.086Z",
  "updatedAt": "2023-08-30T08:49:51.904Z",
  "startTime": "2023-08-30T08:49:48.172Z",
  "endTime": "2023-08-30T08:49:51.898Z",
  "isCancellationRequested": false,
  "error": null
}

See Execution Payload for more information about the payload of the execution.

Execution Payload

The payload of an execution is the data that is used, and populated, by the workflow throughout the execution.

{
  "input": {
    // input values
  },
  "actions": {
    "<id>": {
      "output": {
        // output values of action
      }
    }
  }
}

Input

The input object contains the input that was provided when the workflow was executed.

Actions

The actions object contains a map of all the action execution data from your workflow.

The keys inside the actions correspond with the id properties that we used within your worfklow.

For example, if your workflow looks as follows:

# ...
 
actions:
  - id: createConnection
    name: didcomm/createConnection@v1
 
  - id: requestPresentation
    name: didcomm/requestPresentation@v1
    attributes:
      # ... requestPresentation attributes

The structure of the actions object (when the execution is completed) will look as follows:

{
  "actions": {
    "createConnection": {
      "output": {
        // output from action
      }
    },
    "requestPresentation": {
      "output": {
        // output from action
      }
    }
  }
}

Each action within your workflow will be added to the actions object based on the <id> of the action. The action-specific object contains an output object. The structure of the output object depends on the action being used. See Actions for the output structure of each action.

Execution states

When an execution is created, there are several states that it may encounter while executing:

The 'on hold' state requires further action in order for a workflow to continue executing.

Created

A workflow is in a 'created' state very briefly when the workflow has been triggered, and the execution is created.

Running

The workflow is executing.

On hold

A workflow is in an 'on hold' state when it waits for a state change to occur after an action is executed. For example, executing the didcomm/createConnection action causes the workflow to wait for a user to make a connection via the generated invitationUrl (see the example in Issue an Employee Badge). Once the connection has been made, the workflow will continue running.

Failed

The workflow has failed to run because of an error. The error will be displayed at the top of the execution log and in the execution object.

Cancelled

The execution of the workflow has been cancelled by a user. You can cancel an execution through the kebab menu in the execution tab.

Manually Using the UI

The easiest way to extract data from an execution while staying in the Paradym platform, is through the UI. This method is useful for manual or single-use workflows like registering a credential definition. Using the UI for executions is also recommended for testing purposes.

Follow these steps to extract data from a worfklow through the UI:

Navigate to the workflow

Choose the workflow that you want to execute from your list of workflows.

Click on the 'Executions' tab in the sidebar

The workflow's previous executions (if it has any) are listed here.

Click on the execution

Clicking on an execution will show all data for that specific execution.

See Execution Payload for more detailed information about the data shown.

Data can now be copied to your clipboard by hovering over the data and selecting it. You can now use the data in other workflows, in your solution, or wherever you need it.