Skip to content

Concept of Context

When referring to Context within the Dotflow library, we are talking about how data is transferred within tasks. The Context is essentially a class embedded in every task return. This class is standardized, and you can access its value through the storage object.

Note

The Context class pattern is applied to the Initial Context and the Previous Context of a task.

Accessing context data

from dotflow import Context

new_context = Context(
    storage={"foo": [0, 1, 2, 3]}
)

print(new_context.time)
print(new_context.task_id)
print(new_context.workflow_id)
print(new_context.storage)

For implementation details of the class, you can access them here