Skip to content

Conversation

@efunneko
Copy link
Collaborator

PR 1: Foundation - Data Models & Constants

Overview

This PR introduces the foundational data models and utilities required by the Prescriptive Workflows feature. These are shared across all workflow components and define the contract for workflow-related A2A communication.

Branch Information

  • Branch Name: pr/workflows-1-foundation
  • Target: feature/prescriptive-workflows

Files Changed

src/solace_agent_mesh/common/data_parts.py

New Pydantic models for workflow messages:

Model Purpose
StructuredInvocationRequest Request for schema-validated agent invocation
StructuredInvocationResult Response from schema-validated agent execution
ArtifactRef Reference to an artifact (name + version)
WorkflowExecutionStartData Signals workflow execution start
WorkflowNodeExecutionStartData Signals node execution start (with node-type-specific fields)
WorkflowNodeExecutionResultData Signals node execution completion
WorkflowMapProgressData Progress updates for map node iterations
WorkflowExecutionResultData Signals workflow execution completion
SwitchCaseInfo Case information for switch nodes

src/solace_agent_mesh/common/constants.py

New constants:

  • EXTENSION_URI_SCHEMAS - URI for schema extension in agent cards
  • EXTENSION_URI_AGENT_TYPE - URI for agent type extension

src/solace_agent_mesh/common/a2a/types.py

New type definitions:

  • SchemasExtensionParams - Parameters for schema extension in agent cards

src/solace_agent_mesh/common/a2a/__init__.py

Re-exports:

  • StructuredInvocationRequest
  • StructuredInvocationResult

src/solace_agent_mesh/common/agent_card_utils.py

New utility:

  • get_schemas_from_agent_card() - Extract input/output schemas from agent card extensions

Key Concepts

Structured Invocation Pattern

The StructuredInvocationRequest and StructuredInvocationResult models enable a "function call" pattern for agents:

  1. Caller sends StructuredInvocationRequest with input data and optional schemas
  2. Agent validates input, executes, validates output
  3. Agent returns StructuredInvocationResult with artifact reference or error

This pattern is used by workflows but is generic enough for any programmatic caller.

Workflow Visualization Events

The WorkflowNode* data models provide real-time execution visibility:

  • Start events include node type, input artifact, and type-specific metadata
  • Result events include status, output artifact, and error details
  • Map progress events track iteration progress

Adds the foundational data models and utilities required by the
Prescriptive Workflows feature:
- StructuredInvocationRequest/Result data parts
- WorkflowExecution* data parts for visualization
- Extension URI constants
- Agent card schema utilities
@efunneko efunneko changed the title PR 1: Foundation - Data Models & Constants feat(DATAGO-114389): PR 1: Foundation - Data Models & Constants Dec 21, 2025
@efunneko efunneko self-assigned this Dec 21, 2025
@efunneko efunneko marked this pull request as ready for review December 21, 2025 14:45
@alimosaed alimosaed self-requested a review January 6, 2026 19:18
Copy link
Collaborator

@alimosaed alimosaed left a comment

Choose a reason for hiding this comment

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

In addition to the above comments, I am wondering how to check the total status of a workflow? Based on these models, the workflow status is determined at the end of workflow (success, failure, cancel); however, the workflow status can be 'running'

)


class StructuredInvocationResult(BaseModel):
Copy link
Collaborator

Choose a reason for hiding this comment

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

[Q] does it always wrap results in an artifact?

status: Literal["success", "failure"] = Field(
..., description="Execution result status"
)
artifact_name: Optional[str] = Field(
Copy link
Collaborator

Choose a reason for hiding this comment

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

[Q] why the ArtifactRef class is not used here to determine the artifact name and version?

max_iterations: Optional[int] = Field(
None, description="Maximum iterations for loop nodes"
)
loop_delay: Optional[str] = Field(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the type string to set unit? (e.g., 1d, 20m)?

type: Literal["structured_invocation_result"] = Field(
"structured_invocation_result", description="The constant type for this data part."
)
status: Literal["success", "failure"] = Field(
Copy link
Collaborator

Choose a reason for hiding this comment

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

[Q] Is not it possible to cancel an agent? If it is, 'cancel' can be another status.

TEXT_ARTIFACT_CONTEXT_DEFAULT_LENGTH = 100000 # default number of characters to load from a text artifact

# Extension URIs
EXTENSION_URI_SCHEMAS = "https://solace.com/a2a/extensions/sam/schemas"
Copy link
Collaborator

Choose a reason for hiding this comment

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

These constant URLs refer to invalid pages. This PR does not show their application; however, they depend the repository to some constant webpages that needs more attention.

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