Table: aws_sfn_state_machine_execution_history - Query AWS Step Functions State Machine Execution History using SQL
The AWS Step Functions State Machine Execution History is a feature of AWS Step Functions that allows you to track the execution history of your state machines. It provides a detailed, near real-time, view of the step-by-step progress of each execution. This helps in monitoring workflows, diagnosing issues, and understanding the state transitions in your applications.
Table Usage Guide
The aws_sfn_state_machine_execution_history
table in Steampipe provides you with information about the execution history of a state machine within AWS Step Functions. This table allows you, as a DevOps engineer, to query execution-specific details, including execution status, start and end dates, input and output data, and associated metadata. You can utilize this table to gather insights on state machine executions, such as the status of executions, duration of executions, and verification of input and output data. The schema outlines the various attributes of the state machine execution history for you, including the execution ARN, state entered time, state exited time, and state name.
Examples
Basic info
Analyze the history of AWS Step Functions state machine executions to understand the sequence and timing of events. This can be useful for debugging purposes or gaining insights into workflow performance and efficiency.
select id, execution_arn, previous_event_id, timestamp, typefrom aws_sfn_state_machine_execution_history;
select id, execution_arn, previous_event_id, timestamp, typefrom aws_sfn_state_machine_execution_history;
List execution started event details
This query can be used to gain insights into the specific details of events that initiated the execution of a process in a state machine. It's particularly useful in monitoring and debugging scenarios, where understanding the input and role associated with the start of an execution can help identify potential issues or inefficiencies.
select id, execution_arn, execution_started_event_details -> 'Input' as event_input, execution_started_event_details -> 'InputDetails' as event_input_details, execution_started_event_details ->> 'RoleArn' as event_role_arnfrom aws_sfn_state_machine_execution_historywhere type = 'ExecutionStarted';
select id, execution_arn, json_extract(execution_started_event_details, '$.Input') as event_input, json_extract(execution_started_event_details, '$.InputDetails') as event_input_details, json_extract(execution_started_event_details, '$.RoleArn') as event_role_arnfrom aws_sfn_state_machine_execution_historywhere type = 'ExecutionStarted';
Schema for aws_sfn_state_machine_execution_history
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
activity_failed_event_details | jsonb | Contains details about an activity that failed during an execution. | |
activity_schedule_failed_event_details | jsonb | Contains details about an activity schedule event that failed during an execution. | |
activity_scheduled_event_details | jsonb | Contains details about an activity scheduled during an execution. | |
activity_started_event_details | jsonb | Contains details about the start of an activity during an execution. | |
activity_succeeded_event_details | jsonb | Contains details about an activity that successfully terminated during an execution. | |
activity_timed_out_event_details | jsonb | Contains details about an activity timeout that occurred during an execution. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
execution_aborted_event_details | jsonb | Contains details about an abort of an execution. | |
execution_arn | text | The Amazon Resource Name (ARN) that identifies the execution. | |
execution_failed_event_details | jsonb | Contains details about an execution failure event. | |
execution_started_event_details | jsonb | Contains details about the start of the execution. | |
execution_succeeded_event_details | jsonb | Contains details about the successful termination of the execution. | |
execution_timed_out_event_details | jsonb | Contains details about the execution timeout that occurred during the execution. | |
id | text | The id of the event. | |
lambda_function_failed_event_details | jsonb | Contains details about a lambda function that failed during an execution. | |
lambda_function_schedule_failed_event_details | jsonb | Contains details about a failed lambda function schedule event that occurred during an execution. | |
lambda_function_scheduled_event_details | jsonb | Contains details about a lambda function scheduled during an execution. | |
lambda_function_start_failed_event_details | jsonb | Contains details about a lambda function that failed to start during an execution. | |
lambda_function_succeeded_event_details | jsonb | Contains details about a lambda function that terminated successfully during an execution. | |
lambda_function_timed_out_event_details | jsonb | Contains details about a lambda function timeout that occurred during an execution. | |
map_iteration_aborted_event_details | jsonb | Contains details about an iteration of a Map state that was aborted. | |
map_iteration_failed_event_details | jsonb | Contains details about an iteration of a Map state that failed. | |
map_iteration_started_event_details | jsonb | Contains details about an iteration of a Map state that was started. | |
map_iteration_succeeded_event_details | jsonb | Contains details about an iteration of a Map state that succeeded. | |
map_state_started_event_details | jsonb | Contains details about Map state that was started. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
previous_event_id | text | The id of the previous event. | |
region | text | The AWS Region in which the resource is located. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
state_entered_event_details | jsonb | Contains details about a state entered during an execution. | |
state_exited_event_details | jsonb | Contains details about an exit from a state during an execution. | |
task_failed_event_details | jsonb | Contains details about the failure of a task. | |
task_scheduled_event_details | jsonb | Contains details about a task that was scheduled. | |
task_start_failed_event_details | jsonb | Contains details about a task that failed to start. | |
task_started_event_details | jsonb | Contains details about a task that was started. | |
task_submit_failed_event_details | jsonb | Contains details about a task that where the submit failed. | |
task_submitted_event_details | jsonb | Contains details about a submitted task. | |
task_succeeded_event_details | jsonb | Contains details about a task that succeeded. | |
task_timed_out_event_details | jsonb | Contains details about a task that timed out. | |
timestamp | timestamp with time zone | The date and time the event occurred. | |
title | text | Title of the resource. | |
type | text | The type of the event. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws
You can pass the configuration to the command with the --config
argument:
steampipe_export_aws --config '<your_config>' aws_sfn_state_machine_execution_history