Skip to content

Conversation

@peter-smith-phd
Copy link

Problem

When developing with AWS Step Functions, the current UI allows the user to start a state machine execution via the
context menu in the AWS Explorer view. However, once the execution has started, it's not possible to view the execution
details, or to learn whether the execution succeed, failed, or is still running. Additionally, developers will want to view the final output of the state machine, as well as the execution history steps. These steps are all necessary for them to proactively debug their state machine code.

Solution

This PR adds state machine executions as child nodes underneath the state machine name in the AWS Explorer. When a state machine execution is started, the new execution is shown (in running state). Up to 10 of the most recent executions are shown in the explorer, which should be enough given that developers will be manually running and validating their state machine, rather than running them at scale.

image

In future PRs, I'd like to add:

  1. A "Stop Execution" context menu item to abort a running state machine execution.
  2. The ability to see the final result of the execution.
  3. The ability to view the entire history of the execution, similar to what's shown in the Step Functions web console.

This current PR is the basis for this future work.


  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@peter-smith-phd peter-smith-phd requested a review from a team as a code owner August 8, 2025 18:51
@amazon-inspector-ohio
Copy link

⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done

@github-actions
Copy link

github-actions bot commented Aug 8, 2025

  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

@amazon-inspector-ohio
Copy link

✅ I finished the code review, and didn't find any security or code quality issues.

@peter-smith-phd peter-smith-phd force-pushed the feature/sfn_executions branch from ac3578c to cb63aa1 Compare August 9, 2025 17:22
@peter-smith-phd
Copy link
Author

Hi @zelzhou and @anthonyting, I recently submitted this PR, but then I saw you're also doing some active work on displaying Step Functions executions. I don't think my change overlaps with your change, but I'd love your feedback on this PR.

Hopefully you're willing to accept community contributions, especially from a former colleague :-)

getNoChildrenPlaceholderNode: async () =>
new PlaceholderNode(
this,
localize('AWS.explorerNode.stepfunctions.noStateMachineExecution', '[No Executions found]')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new translation keys that are introduced (including the ones below) need to be added to the localisation file - core/package.nls.json

Also, for the translation key construction logic, I belive the toolkit team prefers to have a service name as a higher-order node going after AWS, like our existing keys: AWS.stepFunctions....
Though I don't have a strong opinion on that, I am good to keep these as is if the toolkit team is fine with it

@witness-me
Copy link
Contributor

witness-me commented Jan 14, 2026

Hi @peter-smith-phd, I apologize on the team's behalf for taking so long to review your PR - we'll be on top of your future contributions if you are still up to extending the functionality as stated in the description.

To provide some context, we are currently working on introducing execution details page on the toolkit, but we will be happy to accept contributions that improve overall experience of working with SFN via toolkit. The current PR does not overlap with our change and I really love the feature you are adding here!


Let me comment on your future ideas to rule out potential conflicts:

  • A "Stop Execution" context menu item to abort a running state machine execution. - this one is great, and it does not cause any conflicts to our work, feel free to add this
  • The ability to see the final result of the execution. - I'm not sure what specifically you meant here, but if it's related to the nodes/tooltips in the explorer panel, I think you are also good to go. Otherwise, we'll need more details to figure out if it's something redundant
  • The ability to view the entire history of the execution, similar to what's shown in the Step Functions web console. - This part is on us 🙂

A couple of additional comments about current CR:

  • The functionality you are adding here is great, but I also think we should make it possible to refresh the status of the executions - the best idea I have in mind is adding a context menu item on the state machine to refresh all of its executions (but any other way also works). What do you think?
  • The CR has a merge conflict and needs to be rebased

I will also ask someone else for SFN to review this PR

@peter-smith-phd
Copy link
Author

Hi @witness-me, thanks for the feedback. It's been a while since I looked at this PR, but I'll review it again next week and make your recommended updates. Thanks!

Comment on lines +121 to +122
const dateA = nodeA.details.startDate as Date // startDate will never be undefined.
const dateB = nodeB.details.startDate as Date
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering if we should use satisfies keyword here?

*/
export class StateMachineNode extends AWSTreeNodeBase implements AWSResourceNode {
public static readonly contextValue = 'awsStateMachineNode'
public static readonly maxExecutionsToShow = 10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thinking about the UX here - I think 10 is a good default but should we offer any ways to filter this to specific execution statuses? wondering if beside the state machine name we could show a filter and/or more options to customize what executions show up.

* Assuming the state machine execution was started via a StateMachineNode in the
* AWS Explorer, refresh the list of executions, so this new execution will appear.
*/
private async refreshExplorerNode(node?: StateMachineNode): Promise<void> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice - I don't see anything that periodically polls the running executions, I think that could be a useful addition too.

@peter-smith-phd
Copy link
Author

Sorry, accidentally closed this PR when I was rebasing (with 6 months of changes). I'll shortly re-test and make changes based on feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants