Allow flows to create tasks with custom arguments that survive serialization

Registered by Greg Hill

A use-case I keep running into is the ability for a flow to define task-specific parameters that will be stored with the task when it is serialized and sent across the wire to workers to process. For example, something like this pseudocode:

flow = Flow('build-cluster')
for node in cluster.nodes:
    flow.add(Task('build-node', node.id))

Since it would be perhaps onerously difficult to support any set of valid python arguments, I would settle for a dictionary, such as:

Task('build-node', task_args={'node_id': node.id})

And then within the Task.execute() we would get the data back as self.task_args['node_id']

The same per-task-instance state is not really accomplishable with the current 'store', and there's no way to scope the store to the task being run, so having the data in the task itself seems like the most appropriate way to go.

Blueprint information

Status:
Complete
Approver:
None
Priority:
Medium
Drafter:
Greg Hill
Direction:
Approved
Assignee:
Greg Hill
Definition:
Superseded
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
Greg Hill

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.