diff --git a/client/src/api/schema/schema.ts b/client/src/api/schema/schema.ts index 41ce1a76cdca..fae38cfae4b9 100644 --- a/client/src/api/schema/schema.ts +++ b/client/src/api/schema/schema.ts @@ -7436,7 +7436,7 @@ export interface components { * InvocationSerializationView * @enum {string} */ - InvocationSerializationView: "element" | "collection"; + InvocationSerializationView: "element" | "collection" | "step_states"; /** * InvocationSortByEnum * @enum {string} @@ -12451,7 +12451,8 @@ export interface components { WorkflowInvocationResponse: | components["schemas"]["WorkflowInvocationElementView"] | components["schemas"]["LegacyWorkflowInvocationElementView"] - | components["schemas"]["WorkflowInvocationCollectionView"]; + | components["schemas"]["WorkflowInvocationCollectionView"] + | components["schemas"]["WorkflowInvocationStepStateView"]; /** WorkflowInvocationStateSummary */ WorkflowInvocationStateSummary: { /** @@ -12479,6 +12480,60 @@ export interface components { [key: string]: number | undefined; }; }; + /** WorkflowInvocationStepStateView */ + WorkflowInvocationStepStateView: { + /** + * Create Time + * Format: date-time + * @description The time and date this item was created. + */ + create_time: string; + /** + * History ID + * @description The encoded ID of the history associated with the invocation. + * @example 0123456789ABCDEF + */ + history_id: string; + /** + * ID + * @description The encoded ID of the workflow invocation. + * @example 0123456789ABCDEF + */ + id: string; + /** + * Model class + * @description The name of the database model class. + * @constant + */ + model_class: "WorkflowInvocation"; + /** + * Invocation state + * @description State of workflow invocation. + */ + state: components["schemas"]["InvocationState"]; + /** + * Steps + * @description Steps of the workflow invocation. + */ + steps: components["schemas"]["InvocationStep"][]; + /** + * Update Time + * Format: date-time + * @description The last time and date this item was updated. + */ + update_time: string; + /** + * UUID + * @description Universal unique identifier of the workflow invocation. + */ + uuid?: string | string | null; + /** + * Workflow ID + * @description The encoded Workflow ID associated with the invocation. + * @example 0123456789ABCDEF + */ + workflow_id: string; + }; /** * WorkflowModuleType * @description Available types of modules that represent a step in a Workflow. diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 0291c08fbced..30a49f37d386 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -8650,7 +8650,7 @@ def to_dict(self, view="collection", value_mapper=None, step_details=False, lega if rval["state"] is None: # bugs could result in no state being set rval["state"] = self.states.FAILED - if view == "element": + if view in ["element", "step_states"]: steps = [] for step in self.steps: if step_details: @@ -8671,7 +8671,7 @@ def to_dict(self, view="collection", value_mapper=None, step_details=False, lega else: steps.append(v) rval["steps"] = steps - + if view == "element": inputs = {} for input_item_association in self.input_datasets + self.input_dataset_collections: if input_item_association.history_content_type == "dataset": diff --git a/lib/galaxy/schema/invocation.py b/lib/galaxy/schema/invocation.py index dffb7873bd00..ad8963951c1e 100644 --- a/lib/galaxy/schema/invocation.py +++ b/lib/galaxy/schema/invocation.py @@ -566,6 +566,10 @@ class WorkflowInvocationCollectionView(Model, WithModelClass): model_class: INVOCATION_MODEL_CLASS = ModelClassField(INVOCATION_MODEL_CLASS) +class WorkflowInvocationStepStateView(WorkflowInvocationCollectionView): + steps: List[InvocationStep] = Field(default=..., title="Steps", description="Steps of the workflow invocation.") + + class BaseWorkflowInvocationElementView(WorkflowInvocationCollectionView): inputs: Dict[str, InvocationInput] = Field( default=..., title="Inputs", description="Input datasets/dataset collections of the workflow invocation." @@ -603,7 +607,7 @@ class WorkflowInvocationElementView(BaseWorkflowInvocationElementView): class WorkflowInvocationResponse(RootModel): root: Annotated[ - Union[WorkflowInvocationElementView, LegacyWorkflowInvocationElementView, WorkflowInvocationCollectionView], + Union[WorkflowInvocationElementView, LegacyWorkflowInvocationElementView, WorkflowInvocationCollectionView, WorkflowInvocationStepStateView], Field(union_mode="left_to_right"), ] @@ -614,6 +618,8 @@ def from_dict(as_dict: Dict[str, Any], view: "InvocationSerializationView", lega # performant, and will likely yield clearer error messages. if view == InvocationSerializationView.collection: root = WorkflowInvocationCollectionView(**as_dict) + elif view == InvocationSerializationView.step_states: + root = WorkflowInvocationStepStateView(**as_dict) elif legacy_job_state: root = LegacyWorkflowInvocationElementView(**as_dict) else: @@ -658,6 +664,7 @@ class CreateInvocationFromStore(StoreContentSource): class InvocationSerializationView(str, Enum): element = "element" collection = "collection" + step_states = "step_states" # collection + steps - for monitoring, lighter than element class InvocationSerializationParams(BaseModel):