Repository navigation
feat: workflow classifier for definitions and execution search - #1268
Merged
Merged
Conversation
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.
v1r3n
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:metadata.classifier(non-blank) wins;agentwhen the AgentSpan stamp (agent_sdk/agentDef) is present;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
WorkflowClassifierutility (+ unit tests).WorkflowSummarygains aclassifierfield (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/searchand/search-v2accept&classifier=(comma-separated), folded into the structured query asclassifier IN (...)— the IndexDAO contract is unchanged, and rawquery=classifier IN (agent)works too.Index backends
V17adds aclassifiercolumn +(classifier, start_time)index onworkflow_index; written on index, whitelisted inPostgresIndexQueryBuilder. Filtering for theworkflowtoken also matches pre-migration NULL rows.V5+SqliteIndexDAO/SqliteIndexQueryBuilder.classifierkeyword mapping on workflow documents (required for ES8'sdynamic: false); the query parsers pass field names through generically, so no parser changes.AgentSpan embedding
conductor-agentspanbumped 0.3.0 → 0.4.2 (first published version with classifier-based agent filtering:&classifier=on/api/agent/executionsand/api/agent/executions/search).:conductor-agentspan-serveron the server classpath after the embedded glue was split out of theaimodule, so the embedded agent endpoints 404'd on a stock build. The module is now included; activation remains gated onconductor.integrations.ai.enabled.Testing
WorkflowClassifierTest, classifier cases inPostgresIndexQueryBuilderTest/SqliteIndexQueryBuilderTest(incl. legacy-NULL-row semantics), REST controller tests for the new params.PostgresIndexDAOTest(Testcontainers) andSqliteIndexDAOTest.agent_sdkstamp →classifier=agent), explicitmetadata.classifier=pipelinedef, untagged def; verified?classifier=on/metadata/workflow,&classifier=andquery=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 theworkflowtoken without leaking intoagent.spotlessApplyclean; full-repo main+test compilation passes.Notes for reviewers
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-tasksendpoints are unchanged — classifier is a workflow-level concept.