AgentSkillsCN

awsflow-stepfunc

使用 awsflow VS Code 扩展中的 StepFuncTool,管理和运行 AWS Step Functions 状态机、执行与活动。

SKILL.md
--- frontmatter
name: awsflow-stepfunc
description: Manage and run AWS Step Functions state machines, executions, and activities using the awsflow VS Code extension StepFuncTool.

awsflow-stepfunc

Use the StepFuncTool language tool in VS Code to manage AWS Step Functions state machines, start and inspect executions, and update definitions.

When to Use

  • User wants to list or describe state machines
  • User wants to start a new execution or inspect existing executions
  • User wants to view execution history (step-by-step events)
  • User wants to update a state machine definition
  • User wants to validate a state machine definition
  • User wants to list or describe activities and map runs

Tool Reference

Tool name: StepFuncTool

Input Schema

json
{
  "command": "<CommandName>",
  "params": { ... }
}

Commands (16 total)

CommandDescription
DescribeActivityDescribe an activity
DescribeExecutionDescribe a specific execution
DescribeMapRunDescribe a Map Run
DescribeStateMachineDescribe a state machine
DescribeStateMachineAliasDescribe a state machine alias
DescribeStateMachineForExecutionDescribe state machine associated with an execution
GetExecutionHistoryGet the step-by-step event history of an execution
ListActivitiesList activities
ListExecutionsList executions for a state machine
ListMapRunsList Map Runs for an execution
ListStateMachineAliasesList aliases for a state machine
ListStateMachinesList all state machines
ListStateMachineVersionsList versions of a state machine
StartExecutionStart a new execution of a state machine
UpdateStateMachineUpdate a state machine definition, role, or configuration
ValidateStateMachineDefinitionValidate an Amazon States Language definition

Parameters

ParameterTypeDescription
stateMachineArnstringState machine ARN (Required by: DescribeStateMachine, StartExecution, UpdateStateMachine; Used by: ListExecutions)
executionArnstringExecution ARN (Required by: DescribeExecution, GetExecutionHistory)
maxResultsnumberMaximum items to return (Used by: ListExecutions, ListStateMachines, GetExecutionHistory)
nextTokenstringPagination token (Used by: ListExecutions, ListStateMachines, GetExecutionHistory)
reverseOrderbooleanReturn events in reverse chronological order (Used by: GetExecutionHistory)
statusFilterstringFilter executions by status. Enum: RUNNING, SUCCEEDED, FAILED, TIMED_OUT, ABORTED (Used by: ListExecutions)
namestringExecution name (Used by: StartExecution)
inputstringJSON string input for execution (Used by: StartExecution)
traceHeaderstringX-Ray trace header (Used by: StartExecution)
definitionstringState machine definition in Amazon States Language (Used by: UpdateStateMachine)
roleArnstringIAM role ARN for the state machine (Used by: UpdateStateMachine)
loggingConfigurationobjectLogging configuration object (Used by: UpdateStateMachine)
tracingConfigurationobjectTracing configuration object (Used by: UpdateStateMachine)
publishbooleanSet true to publish a new version (Used by: UpdateStateMachine)
versionDescriptionstringDescription for the published version (Used by: UpdateStateMachine)

Usage Examples

List all state machines

json
{ "command": "ListStateMachines", "params": { "maxResults": 20 } }

Describe a state machine

json
{ "command": "DescribeStateMachine", "params": { "stateMachineArn": "arn:aws:states:us-east-1:123456789012:stateMachine:MyWorkflow" } }

List executions with status filter

json
{ "command": "ListExecutions", "params": { "stateMachineArn": "arn:aws:states:us-east-1:123456789012:stateMachine:MyWorkflow", "statusFilter": "FAILED", "maxResults": 10 } }

Start a new execution

json
{ "command": "StartExecution", "params": { "stateMachineArn": "arn:aws:states:us-east-1:123456789012:stateMachine:MyWorkflow", "input": "{\"orderId\": \"12345\", \"amount\": 99.99}" } }

Get execution history

json
{ "command": "GetExecutionHistory", "params": { "executionArn": "arn:aws:states:us-east-1:123456789012:execution:MyWorkflow:exec-id", "maxResults": 100, "reverseOrder": true } }

Describe an execution

json
{ "command": "DescribeExecution", "params": { "executionArn": "arn:aws:states:us-east-1:123456789012:execution:MyWorkflow:exec-id" } }

Update state machine definition

json
{ "command": "UpdateStateMachine", "params": { "stateMachineArn": "arn:aws:states:us-east-1:123456789012:stateMachine:MyWorkflow", "definition": "{\"StartAt\": \"Step1\", \"States\": { \"Step1\": { \"Type\": \"Pass\", \"End\": true }}}" } }

Validate a definition

json
{ "command": "ValidateStateMachineDefinition", "params": {} }

Related Services

Step Functions orchestrates workflows across many AWS services:

RelationshipTool
Invokes Lambda functionsLambdaTool
Sends messages to SQSSQSTool
Publishes to SNS topicsSNSTool
Reads/writes DynamoDB tablesDynamoDBTool
Starts Glue jobsGlueTool
Starts EMR stepsEMRTool
Calls API Gateway endpointsAPIGatewayTool
Execution logs in CloudWatchCloudWatchLogTool
IAM roles for executionIAMTool
Deployed via CloudFormationCloudFormationTool

CloudWatch Log Group Naming

Step Functions log groups typically follow:

code
/aws/vendedlogs/states/<state-machine-name>-Logs

Use CloudWatchLogToolDescribeLogGroups with logGroupNamePrefix: "/aws/vendedlogs/states/" to find them.

Tips

  • Use ListStateMachinesDescribeStateMachine to explore definition and configuration.
  • Use ListExecutions with statusFilter: "FAILED" to find failed runs, then GetExecutionHistory to debug step-by-step.
  • StartExecution requires stateMachineArn and accepts a JSON input string.
  • The definition in UpdateStateMachine must be valid Amazon States Language JSON.
  • Use reverseOrder: true in GetExecutionHistory to see the most recent events first.