IceS2 41dfdff43e MINOR: Add logic to handle WorkflowContext on Ingestion (#21425)
* Add logic to handle WorkflowContext on Ingestion

* Revert base.py changes

* Removed comment

* Fix basedpyright complaints

* Make ContextManager automatically add its context to the PipelineStatus

* Small changes

(cherry picked from commit 5b20b845462cfcb568b92dbf22e160226433fae5)
2025-06-03 15:36:28 +00:00

30 lines
745 B
Python

"""
Workflow context definition.
This module defines the WorkflowContext, which holds workflow-level metadata such as the service name.
It is registered with the ContextManager for attribute-based access throughout the workflow system.
"""
from typing import Union
from pydantic import Field
from .base import BaseContext, BaseContextFieldsEnum
class WorkflowContextFieldsEnum(BaseContextFieldsEnum):
"""
Enum defining all available workflow context fields.
"""
SERVICE_NAME = "serviceName"
class WorkflowContext(BaseContext):
"""
Context for workflow-level metadata.
"""
serviceName: Union[str, None] = Field(
default=None, description="Name of the service on which the workflow operates"
)