Skip to content

feat(config): add optional metadata dict to workflow definition #106

@PolyphonyRequiem

Description

@PolyphonyRequiem

Problem

External tooling (dashboards, trackers, CI integrations) that consumes conductor event logs currently has no structured way to know what kind of workflow is running or how to enrich its data. The dashboard, for example, hardcodes ADO URL templates, twig SQLite DB paths, and work-item extraction logic — all tightly coupled to specific workflow implementations.

This coupling means:

  • Non-twig workflows get wrong ADO links or no enrichment at all
  • Adding support for a new tracker (GitHub Issues, Jira) requires dashboard code changes
  • Workflow authors can't declare their own integration metadata

Proposal

Add an optional metadata dict to the workflow section of the YAML config:

workflow:
  name: twig-sdlc
  entry_point: intake
  metadata:
    tracker: ado
    project_url: https://dev.azure.com/org/Project
    work_item_id_agent: intake
    work_item_id_field: epic_id

The metadata is:

  • Passed through to the workflow_started event as-is
  • Available to any event log consumer without parsing YAML source
  • Completely optional — existing workflows emit "metadata": {}

Use Cases

Dashboard enrichment plugins

A dashboard can dispatch to enricher modules based on metadata.tracker:

  • tracker: ado → look up work item hierarchy from twig SQLite DB, generate ADO links
  • tracker: github → fetch issue status from GitHub API
  • tracker: jira → query Jira REST API for ticket details

Work item ID extraction

Instead of hardcoding "look for epic_id in the intake agent output", the dashboard reads metadata.work_item_id_agent and metadata.work_item_id_field to generically extract the tracking ID from any agent's structured output.

Custom workflow tagging

Teams can add arbitrary tags for filtering, grouping, or routing:

metadata:
  team: platform
  environment: staging
  priority: high

Implementation

Two changes (~8 lines total):

  1. Add metadata: dict[str, Any] = Field(default_factory=dict) to WorkflowDef in schema.py
  2. Include "metadata": self.config.workflow.metadata in the workflow_started event emission in workflow.py

No breaking changes. No migration needed. Default is empty dict.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions