Flow Reuse !?
How can I define & reuse a workflow, in etc/project?
You can use file includes via the <> notation. Included files must be located in the etc directory of your project. You can include anywhere in the JSON.
"workflows": [{
"path": "read.json",
"tasks": "<entity/read>"
}]
with
"workflows": [{
"path": "read.json",
"tasks": "<flows/main>"
}]
I got
Error: { [Error: ENOENT, open '/data/workspace/opxi2flowy/etc/flows/main']
it seems it uses tasks param to resolve file name!!
Can you provide me please with a working example with also the read.json file contents !?
Here's an example: https://github.com/apla/dataflo.ws/blob/master/example/yql/etc/project#L27 The included file: https://github.com/apla/dataflo.ws/blob/master/example/yql/etc/entity/test
@katspaugh That works as an include mechanism only! I got it now! but I wish I could mix included tasks with inline ones. This means to be able to write extended flows with reusable, mini tasks. I mean something like this:
{
"path":"test",
"tasks": [{
"include": "<entity/read>",
},{
"$function": "console.print",
"$args": [ "Fetched Entity", "{$entity}" ]
},{
"include": "<entity/play>"
}]
}