-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkflow.json
More file actions
66 lines (66 loc) · 1.64 KB
/
workflow.json
File metadata and controls
66 lines (66 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
"name": "batch-file-processor",
"description": "List files in a directory, loop over each to read and hash, then log results.",
"category": "data",
"features": ["fs", "loop", "crypto", "workflow.log"],
"input_schema": {
"type": "object",
"required": ["input_dir", "output_dir"],
"properties": {
"input_dir": {
"type": "string",
"description": "Directory containing files to process"
},
"output_dir": {
"type": "string",
"description": "Directory to write processed files to"
}
}
},
"definition": {
"timeout": "10m",
"on_timeout": "fail",
"steps": [
{
"id": "list-files",
"type": "action",
"action": "fs.list",
"params": {
"path": "${{inputs.input_dir}}"
},
"timeout": "15s"
},
{
"id": "process-each",
"type": "loop",
"depends_on": ["list-files"],
"config": {
"mode": "for_each",
"over": "steps['list-files'].entries",
"max_iter": 100,
"body": [
{
"id": "hash-file",
"type": "action",
"action": "crypto.hash",
"params": {
"algorithm": "sha256",
"data": "${{loop.item.name}}"
}
}
]
}
},
{
"id": "log-complete",
"type": "action",
"action": "workflow.log",
"depends_on": ["process-each"],
"params": {
"message": "Batch file processing complete",
"output_dir": "${{inputs.output_dir}}"
}
}
]
}
}