Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 2, 2025

Working on implementing the ability to get workflow history length from within a workflow, as requested in issue #390.

Plan for Implementation

  • Explore repository structure and understand current workflow execution flow
  • Identify that the executor tracks lastSequenceID which represents history length
  • Analyze workflow context creation and state management
  • Build and test current codebase to establish baseline
  • Define WorkflowInstanceInfo struct with history length and metadata
  • Add workflow instance info to the workflow state/context
  • Create workflow.WorkflowInstanceInfo(ctx) function to retrieve the information
  • Update executor to maintain history length in workflow state
  • Create tests to validate the functionality
  • Test with sample workflow to verify behavior
  • Update documentation if needed

The feature will allow workflows to call workflow.WorkflowInstanceInfo(ctx) to get metadata including history length, which is useful for deciding when to call ContinueAsNew.

Fixes #390.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

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.

Get workflow history length from within workflow
2 participants