Skip to content

docs: add EdgeConditionWithContext and invocation_state to graph docs#847

Open
yananym wants to merge 1 commit into
strands-agents:mainfrom
yananym:feat/edge-condition-invocation-state-docs
Open

docs: add EdgeConditionWithContext and invocation_state to graph docs#847
yananym wants to merge 1 commit into
strands-agents:mainfrom
yananym:feat/edge-condition-invocation-state-docs

Conversation

@yananym
Copy link
Copy Markdown

@yananym yananym commented May 19, 2026

Description

Document the new EdgeConditionWithContext protocol and invocation_state parameter for graph edge conditions. This adds a "Conditional Edges with Runtime Context" subsection under the
existing Conditional Edges section, showing how conditions can receive runtime context (feature flags, user roles, environment config) passed during graph invocation.

The new section covers:

  • The extended condition signature (def condition(state, *, invocation_state, **kwargs) -> bool)
  • A complete example with role-based and feature-flag-based routing
  • Persistence across interrupt/resume cycles
  • Backwards compatibility with legacy conditions

Related Issues

Companion to strands-agents/sdk-python#1346

Type of Change

  • New content

Checklist

  • I have read the CONTRIBUTING document
  • My changes follow the project's documentation style
  • I have tested the documentation locally using npm run dev
  • Links in the documentation are valid and working

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Screenshot 2026-05-19 at 11 15 47 AM

Document the new edge condition signature that receives invocation_state
for runtime-context-based routing (feature flags, user roles, env config).
Companion to strands-agents/sdk-python#1346.
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.

1 participant