Executions

Documentation for Executions in the EigenLayer-AVS system.

Purpose and Scope#

This document provides a detailed explanation of workflow executions in the AVA SDK JS. Executions represent instances of workflow runs, capturing the entire lifecycle of a workflow's execution, including its triggered state, individual step results, success or failure status, and timing information. This page covers the execution data model, step structure, and API methods for retrieving and working with executions.

Execution Model#

An execution in the AVA SDK represents a single run of a workflow. When a workflow is triggered, an execution is created to track its progress and results.

Execution Data Model Diagram

Sources:

The Execution class implements the ExecutionProps interface and includes the following properties:

PropertyTypeDescription
idstringUnique identifier for the execution
startAtnumberUnix timestamp when the execution started
endAtnumberUnix timestamp when the execution ended
successbooleanWhether the execution was successful
errorstringError message if the execution failed
stepsListStep[]List of steps executed as part of this run
triggerReasonTriggerReasonThe reason that triggered this execution
triggerNamestringThe name of the trigger
triggerOutputOutputDataPropsOutput data from the trigger

Sources:

Step Model#

Each step in an execution represents the running of a specific node within the workflow. The step records the input and output data, timing information, and success status.

Step Output Types Diagram

Sources:

The Step class includes the following properties:

PropertyTypeDescription
nodeIdstringIdentifier of the node this step represents
successbooleanWhether the step executed successfully
logstringLog messages from the step execution
errorstringError message if the step failed
startAtnumberUnix timestamp when the step started
endAtnumberUnix timestamp when the step ended
inputsListstring[]List of inputs provided to the step
outputOutputDataPropsData output by the step

Sources:

The output property is polymorphic and depends on the node type. The SDK supports nine different types of outputs:

  1. ETH Transfer (ETHTransferNode.Output)
  2. GraphQL Query (GraphQLQueryNode.Output)
  3. Contract Read (ContractReadNode.Output)
  4. Contract Write (ContractWriteNode.Output)
  5. Custom Code (CustomCodeNode.Output)
  6. REST API (RestAPINode.Output)
  7. Branch (BranchNode.Output)
  8. Filter (FilterNode.Output)
  9. Loop (LoopNode.Output)

Sources:

Retrieving Executions#

The AVA SDK provides methods to retrieve executions for workflows. These methods allow you to fetch execution details and monitor the results of your workflows.

Execution Retrieval Flow Diagram

Sources:

Getting Executions with Pagination#

The getExecutions method retrieves executions for specified workflows with pagination support:

The limit parameter controls how many executions to retrieve per page. The cursor parameter is used to get the next page of results. The response includes a cursor that can be used to fetch the next set of executions.

Sources:

Execution Count#

To get the total number of executions for one or more workflows:

This method is useful for determining how many times your workflows have been executed.

Sources:

Execution Lifecycle#

Execution Lifecycle Diagram

Sources:

When a workflow is triggered:

  1. An execution is created with a unique ID
  2. The execution records the trigger information
  3. The workflow steps are executed in sequence (or according to the edge connections)
  4. Each step records its inputs, outputs, timing information, and success status
  5. The execution is marked as successful if all steps succeed, or failed if any step fails
  6. The execution records the end time when all steps are complete

The Execution class provides a static fromResponse method that constructs an Execution object from the gRPC response:

Similarly, the Step class provides a static fromResponse method to construct Step objects from gRPC responses:

Sources:

Best Practices#

  • Regularly monitor executions to ensure your workflows are running as expected
  • Use pagination when retrieving executions for workflows with many runs
  • Check step outputs to debug workflow issues
  • Use the execution's success and error fields to determine if the workflow executed successfully
  • Examine individual steps to pinpoint where failures occurred

Sources: