specification icon indicating copy to clipboard operation
specification copied to clipboard

Proposal: agent characteristics extension for OpenWorkflow tasks

Open bassemZohdy opened this issue 3 months ago • 2 comments

Proposal: Agent characteristics for OpenWorkflow tasks

Status: Draft for upstream submission
Owner: OpenWorkflow ADK maintainers
Target baseline: OpenWorkflow DSL 1.0.x

Summary

Add an optional agent extension to task objects so a workflow can declare the model, instruction, tools, output key, memory, provider, and coordinator members needed to execute an agent task. Existing workflows remain valid and non-agent runtimes may ignore or reject the extension according to their extension policy.

Proposed shape

do:
  - summarize:
      agent:
        model: gemini-2.5-flash
        instruction: Summarize the supplied context.
        tools: []
        output_key: summary
      set:
        source: $context.input

The initial schema should define agent as an optional object with strict known fields. sub_agents is recursive and enables coordinator patterns; provider and memory may reference named entries in use.providers and use.memories. Implementations should preserve task-level validation for all non-extension fields.

Compatibility and validation

The extension is additive for the 1.0.x line. A conforming validator should validate the base task after removing the extension key, then validate the extension object against its own versioned schema. Unknown extension fields must produce a source-oriented validation error. Extension versions should be independent from the DSL version and use minor versions for additive fields.

Runtime guidance

An implementation may map the object to its native agent runtime. It should document model-provider configuration, state/output semantics, tool safety, human-input suspension, and sub-agent handoff behavior. The extension must not change the meaning of ordinary call, run, set, or control-flow tasks.

Reference implementation and acceptance cases

This repository contains the reference translation, extension schema, loader tests, provider adapters, team handoff test, human-input suspend/resume test, and compatibility tests for additive 1.0.x patch versions. Upstream review should confirm:

  1. An ordinary 1.0.x workflow remains valid.
  2. An agent task validates and executes with a configured model.
  3. Unknown agent fields fail with a precise path.
  4. A coordinator can hand off to a declared sub-agent.
  5. The extension can evolve independently without weakening base validation.

bassemZohdy avatar Aug 10 '26 10:08 bassemZohdy

I think that's a great idea, and I agree with both points.

The extension framing seems appropriate only while the additional data is truly optional runtime metadata. Once we introduce things like memory, tool execution, suspension for human input, or sub-agent coordination, ignoring the extension could materially change the workflow's behavior. At that point, it would arguably no longer fit the extension model.

I'd therefore propose reworking this around first-class tasks with their own schemas and conformance requirements instead. Providers, memories, tools, models, etc. could still be reusable components referenced from use, while also allowing inline declarations where reuse is unnecessary.

I also agree on the task naming point. agent describes the thing performing the work rather than the action being performed, and it doesn't follow the DSL's imperative naming convention (call, run, set, wait, etc.).

I think infer may actually be a better fit than generate, as it describes the model operation without tying it specifically to text generation. We could potentially complement it with a separate embed task for embeddings, keeping both actions explicit and readable:

do:
  - summarize:
      infer:
        model: gemini-2.5-flash
        instruction: Summarize the supplied context.
        tools: []
        memory: conversation
        output: summary

  - vectorize:
      embed:
        model: text-embedding-3-small
        input: ${ .summary }
        output: embedding

That could also provide a cleaner path for the point you raised about model endpoints. infer could cover inference-oriented APIs such as responses or completions, while embed could represent embedding generation as a distinct workflow action. The exact protocol or endpoint used to perform either operation could remain an implementation concern unless explicitly specified by the workflow.

For models, I'd also propose leaving room for both provider-hosted and self-hosted models. A runtime could, at its discretion, resolve and run a model locally rather than requiring an external provider. The model could potentially reference a model artifact from a well-known registry such as Hugging Face, for example:

infer:
  model:
    source: huggingface:google/gemma-3-4b-it
  instruction: Summarize the supplied context.

The exact source syntax would need to be defined, but I'd favor a generic model source/reference mechanism rather than enumerating supported registries. That would allow runtimes to support Hugging Face or other standardized model sources without making a particular hosting or inference technology part of the DSL.

A runtime that supports such a source could download and execute the model itself; one that doesn't could reject it as unsupported. This would keep model execution capabilities at the runtime's discretion while still giving workflow authors a portable way to identify the model they intend to use.

So a possible revised direction could be:

  • define first-class imperative tasks such as infer and embed rather than an agent extension;
  • allow model, provider, tool, and memory definitions to be referenced or declared inline;
  • support both provider-hosted and, at the runtime's discretion, self-hosted models;
  • allow models to be resolved from external model sources or registries without strongly typing the supported registries;
  • provide sensible implicit defaults where possible;
  • allow the model operation or target to be specified when the default is insufficient;
  • define tool execution, memory, human suspension/resume, and delegation as part of infer semantics where applicable;
  • preserve the existing semantics of call, run, set, and the other task types.

I think that direction would align better with the DSL design principles, while also providing a stronger foundation for both model inference and more agentic workflow capabilities.

cdavernas avatar Aug 10 '26 18:08 cdavernas

I agree that we need to support agents calling in some sort of form, and I liked your proposal, @cdavernas. Nevertheless, I also think we need to review the a2a and mcp tasks since I feel like we will have to clarify each usage.

I see a2a and mcp as a way for users to interact with agent-specific APIs, although those are not designed/meant to be consumed for non-agentic systems. One can justify it, though, when a workflow is generated on the fly by an agent (e.g., as a planner-oriented system) and it uses these tasks to interface with another agent.

At least, clarification is needed for this new add-on.

I can work on it after 1.1.0 since we already have enough to wrap it up in the upcoming days. We can do 1.2.0 shortly after that.

ricardozanini avatar Aug 11 '26 16:08 ricardozanini