Skip to content

feat: workflow classifier for definitions and execution search - #1268

Merged
bradyyie merged 4 commits into
mainfrom
feature/workflow-classifier
Jul 9, 2026
Merged

bradyyie merged 4 commits into
mainfrom
feature/workflow-classifier

Conversation

@bradyyie

@bradyyie bradyyie commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a workflow classifier — a tag that distinguishes kinds of workflow definitions and executions (plain workflows vs AgentSpan agents vs any future kind), derived from WorkflowDef.metadata:

  1. explicit metadata.classifier (non-blank) wins;
  2. otherwise agent when the AgentSpan stamp (agent_sdk / agentDef) is present;
  3. otherwise workflow (plain, untagged def).

This is the OSS equivalent of the classifier support in Orkes Conductor, adapted to the OSS IndexDAO architecture. It pairs with conductor-agentspan:0.4.2 (agentspan-ai/agentspan#306), which uses it for classifier-based agent filtering.

Changes

common

  • New WorkflowClassifier utility (+ unit tests).
  • WorkflowSummary gains a classifier field (proto field 23), populated at index time from the execution's workflow definition; protos regenerated.

REST

  • GET /api/metadata/workflow?classifier=agent|workflow|<tag> — filters definitions by derived classifier.
  • GET /api/workflow/search and /search-v2 accept &classifier= (comma-separated), folded into the structured query as classifier IN (...) — the IndexDAO contract is unchanged, and raw query=classifier IN (agent) works too.

Index backends

  • Postgres: Flyway V17 adds a classifier column + (classifier, start_time) index on workflow_index; written on index, whitelisted in PostgresIndexQueryBuilder. Filtering for the workflow token also matches pre-migration NULL rows.
  • SQLite: same, via V5 + SqliteIndexDAO/SqliteIndexQueryBuilder.
  • ES7 / ES8 / OS v2 / OS v3: classifier keyword mapping on workflow documents (required for ES8's dynamic: false); the query parsers pass field names through generically, so no parser changes.

AgentSpan embedding

  • conductor-agentspan bumped 0.3.0 → 0.4.2 (first published version with classifier-based agent filtering: &classifier= on /api/agent/executions and /api/agent/executions/search).
  • Fixed a packaging gap: nothing put :conductor-agentspan-server on the server classpath after the embedded glue was split out of the ai module, so the embedded agent endpoints 404'd on a stock build. The module is now included; activation remains gated on conductor.integrations.ai.enabled.

Testing

  • Unit tests: WorkflowClassifierTest, classifier cases in PostgresIndexQueryBuilderTest / SqliteIndexQueryBuilderTest (incl. legacy-NULL-row semantics), REST controller tests for the new params.
  • Integration: classifier index/search scenarios in PostgresIndexDAOTest (Testcontainers) and SqliteIndexDAOTest.
  • Live end-to-end against a local Postgres-backed server with AgentSpan embedded: agent deployed/run via the Python SDK (agent_sdk stamp → classifier=agent), explicit metadata.classifier=pipeline def, untagged def; verified ?classifier= on /metadata/workflow, &classifier= and query=classifier IN (...) on /workflow/search, /api/agent/list, /api/agent/executions?classifier=agent, /api/agent/executions/search?classifier=, and that hand-inserted pre-migration NULL rows match the workflow token without leaking into agent.
  • spotlessApply clean; full-repo main+test compilation passes.

Notes for reviewers

  • Untagged executions index the literal workflow (never NULL going forward) so filtering is plain equality across every backend; the NULL-handling in the Postgres/SQLite builders exists only for rows indexed before the migration. Pre-existing ES/OS documents won't match classifier filters until re-indexed.
  • search-by-tasks endpoints are unchanged — classifier is a workflow-level concept.

bradyyie and others added 4 commits July 9, 2026 11:14
Backports the Orkes workflow classifier concept to OSS. The classifier is a
tag derived from WorkflowDef.metadata (explicit metadata.classifier wins,
else 'agent' when the AgentSpan stamp agent_sdk/agentDef is present, else
'workflow' for plain untagged defs).

- common: new WorkflowClassifier utility; WorkflowSummary gains a classifier
  field (proto field 23) populated at index time
- rest: GET /metadata/workflow supports ?classifier= filtering; workflow
  /search and /search-v2 support &classifier=, folded into the structured
  query as 'classifier IN (...)'
- postgres/sqlite: classifier column on workflow_index (Flyway V17 / V5),
  written on index and filterable via the query builders; the 'workflow'
  token also matches pre-migration NULL rows
- es7/es8/os2/os3: classifier keyword mapping for workflow documents
0.4.2 is the first published version containing classifier-based agent
filtering (agentspan-ai/agentspan#306): listAgents() derives agent-ness
via the workflow classifier, and the /api/agent/executions[/search]
endpoints accept a classifier parameter backed by the classifier search
field added to the index backends in this branch.
Nothing put the agentspan-server module on the server classpath after the
embedded AgentSpan glue was split out of the ai module, so the embedded
agent endpoints returned 404 on a stock build regardless of
conductor.integrations.ai.enabled. Activation remains gated on that
property; the dependency just makes the module available.
@bradyyie
bradyyie merged commit 538c450 into main Jul 9, 2026
7 checks passed
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.

2 participants