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:
Property | Type | Description |
---|---|---|
id | string | Unique identifier for the execution |
startAt | number | Unix timestamp when the execution started |
endAt | number | Unix timestamp when the execution ended |
success | boolean | Whether the execution was successful |
error | string | Error message if the execution failed |
stepsList | Step[] | List of steps executed as part of this run |
triggerReason | TriggerReason | The reason that triggered this execution |
triggerName | string | The name of the trigger |
triggerOutput | OutputDataProps | Output 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:
Property | Type | Description |
---|---|---|
nodeId | string | Identifier of the node this step represents |
success | boolean | Whether the step executed successfully |
log | string | Log messages from the step execution |
error | string | Error message if the step failed |
startAt | number | Unix timestamp when the step started |
endAt | number | Unix timestamp when the step ended |
inputsList | string[] | List of inputs provided to the step |
output | OutputDataProps | Data output by the step |
Sources:
The output
property is polymorphic and depends on the node type. The SDK supports nine different types of outputs:
- ETH Transfer (
ETHTransferNode.Output
) - GraphQL Query (
GraphQLQueryNode.Output
) - Contract Read (
ContractReadNode.Output
) - Contract Write (
ContractWriteNode.Output
) - Custom Code (
CustomCodeNode.Output
) - REST API (
RestAPINode.Output
) - Branch (
BranchNode.Output
) - Filter (
FilterNode.Output
) - 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:
- An execution is created with a unique ID
- The execution records the trigger information
- The workflow steps are executed in sequence (or according to the edge connections)
- Each step records its inputs, outputs, timing information, and success status
- The execution is marked as successful if all steps succeed, or failed if any step fails
- 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
anderror
fields to determine if the workflow executed successfully - Examine individual steps to pinpoint where failures occurred
Sources: