Skip to content

workflow

WorkflowCreateV1

Bases: _WorkflowBaseV1

Task for Workflow creation.

Source code in fractal_server/app/schemas/v1/workflow.py
138
139
140
141
142
143
144
class WorkflowCreateV1(_WorkflowBaseV1):
    """
    Task for `Workflow` creation.
    """

    # Validators
    _name = validator("name", allow_reuse=True)(valstr("name"))

WorkflowExportV1

Bases: _WorkflowBaseV1

Class for Workflow export.

Attributes:

Name Type Description
task_list list[WorkflowTaskExportV1]
Source code in fractal_server/app/schemas/v1/workflow.py
185
186
187
188
189
190
191
192
193
class WorkflowExportV1(_WorkflowBaseV1):
    """
    Class for `Workflow` export.

    Attributes:
        task_list:
    """

    task_list: list[WorkflowTaskExportV1]

WorkflowImportV1

Bases: _WorkflowBaseV1

Class for Workflow import.

Attributes:

Name Type Description
task_list list[WorkflowTaskImportV1]
Source code in fractal_server/app/schemas/v1/workflow.py
171
172
173
174
175
176
177
178
179
180
181
182
class WorkflowImportV1(_WorkflowBaseV1):
    """
    Class for `Workflow` import.

    Attributes:
        task_list:
    """

    task_list: list[WorkflowTaskImportV1]

    # Validators
    _name = validator("name", allow_reuse=True)(valstr("name"))

WorkflowReadV1

Bases: _WorkflowBaseV1

Task for Workflow read from database.

Attributes:

Name Type Description
id int
project_id int
task_list list[WorkflowTaskReadV1]
project ProjectReadV1
Source code in fractal_server/app/schemas/v1/workflow.py
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
class WorkflowReadV1(_WorkflowBaseV1):
    """
    Task for `Workflow` read from database.

    Attributes:
        id:
        project_id:
        task_list:
        project:
    """

    id: int
    project_id: int
    task_list: list[WorkflowTaskReadV1]
    project: ProjectReadV1
    timestamp_created: datetime

WorkflowTaskCreateV1

Bases: _WorkflowTaskBaseV1

Class for WorkflowTask creation.

Attributes:

Name Type Description
order Optional[int]
Source code in fractal_server/app/schemas/v1/workflow.py
40
41
42
43
44
45
46
47
48
49
50
class WorkflowTaskCreateV1(_WorkflowTaskBaseV1):
    """
    Class for `WorkflowTask` creation.

    Attributes:
        order:
    """

    order: Optional[int]
    # Validators
    _order = validator("order", allow_reuse=True)(valint("order", min_val=0))

WorkflowTaskExportV1

Bases: _WorkflowTaskBaseV1

Class for WorkflowTask export.

Attributes:

Name Type Description
task TaskExportV1
Source code in fractal_server/app/schemas/v1/workflow.py
83
84
85
86
87
88
89
90
91
class WorkflowTaskExportV1(_WorkflowTaskBaseV1):
    """
    Class for `WorkflowTask` export.

    Attributes:
        task:
    """

    task: TaskExportV1

WorkflowTaskImportV1

Bases: _WorkflowTaskBaseV1

Class for WorkflowTask import.

Attributes:

Name Type Description
task TaskImportV1
Source code in fractal_server/app/schemas/v1/workflow.py
72
73
74
75
76
77
78
79
80
class WorkflowTaskImportV1(_WorkflowTaskBaseV1):
    """
    Class for `WorkflowTask` import.

    Attributes:
        task:
    """

    task: TaskImportV1

WorkflowTaskReadV1

Bases: _WorkflowTaskBaseV1

Class for WorkflowTask read from database.

Attributes:

Name Type Description
id int
order Optional[int]
workflow_id int
task_id int
task TaskReadV1
Source code in fractal_server/app/schemas/v1/workflow.py
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
class WorkflowTaskReadV1(_WorkflowTaskBaseV1):
    """
    Class for `WorkflowTask` read from database.

    Attributes:
        id:
        order:
        workflow_id:
        task_id:
        task:
    """

    id: int
    order: Optional[int]
    workflow_id: int
    task_id: int
    task: TaskReadV1

WorkflowTaskStatusTypeV1

Bases: str, Enum

Define the available values for the status of a WorkflowTask.

This model is used within the Dataset.history attribute, which is constructed in the runner and then used in the API (e.g. in the api/v1/project/{project_id}/dataset/{dataset_id}/status endpoint).

Attributes:

Name Type Description
SUBMITTED

The WorkflowTask is part of a running job.

DONE

The most-recent execution of this WorkflowTask was successful.

FAILED

The most-recent execution of this WorkflowTask failed.

Source code in fractal_server/app/schemas/v1/workflow.py
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
class WorkflowTaskStatusTypeV1(str, Enum):
    """
    Define the available values for the status of a `WorkflowTask`.

    This model is used within the `Dataset.history` attribute, which is
    constructed in the runner and then used in the API (e.g. in the
    `api/v1/project/{project_id}/dataset/{dataset_id}/status` endpoint).

    Attributes:
        SUBMITTED: The `WorkflowTask` is part of a running job.
        DONE: The most-recent execution of this `WorkflowTask` was successful.
        FAILED: The most-recent execution of this `WorkflowTask` failed.
    """

    SUBMITTED = "submitted"
    DONE = "done"
    FAILED = "failed"

WorkflowTaskUpdateV1

Bases: _WorkflowTaskBaseV1

Class for WorkflowTask update.

Source code in fractal_server/app/schemas/v1/workflow.py
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
class WorkflowTaskUpdateV1(_WorkflowTaskBaseV1):
    """
    Class for `WorkflowTask` update.
    """

    # Validators
    @validator("meta")
    def check_no_parallelisation_level(cls, m):
        if "parallelization_level" in m:
            raise ValueError(
                "Overriding task parallelization level currently not allowed"
            )
        return m

WorkflowUpdateV1

Bases: _WorkflowBaseV1

Task for Workflow update.

Attributes:

Name Type Description
name Optional[str]
reordered_workflowtask_ids Optional[list[int]]
Source code in fractal_server/app/schemas/v1/workflow.py
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
class WorkflowUpdateV1(_WorkflowBaseV1):
    """
    Task for `Workflow` update.

    Attributes:
        name:
        reordered_workflowtask_ids:
    """

    name: Optional[str]
    reordered_workflowtask_ids: Optional[list[int]]

    # Validators
    _name = validator("name", allow_reuse=True)(valstr("name"))

    @validator("reordered_workflowtask_ids")
    def check_positive_and_unique(cls, value):
        if any(i < 0 for i in value):
            raise ValueError("Negative `id` in `reordered_workflowtask_ids`")
        if len(value) != len(set(value)):
            raise ValueError("`reordered_workflowtask_ids` has repetitions")
        return value

_WorkflowBaseV1

Bases: BaseModel

Base class for Workflow.

Attributes:

Name Type Description
name str

Workflow name.

Source code in fractal_server/app/schemas/v1/workflow.py
109
110
111
112
113
114
115
116
117
class _WorkflowBaseV1(BaseModel):
    """
    Base class for `Workflow`.

    Attributes:
        name: Workflow name.
    """

    name: str

_WorkflowTaskBaseV1

Bases: BaseModel

Base class for WorkflowTask.

Source code in fractal_server/app/schemas/v1/workflow.py
31
32
33
34
35
36
37
class _WorkflowTaskBaseV1(BaseModel):
    """
    Base class for `WorkflowTask`.
    """

    meta: Optional[dict[str, Any]] = None
    args: Optional[dict[str, Any]] = None