-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkflow.json
More file actions
63 lines (63 loc) · 1.52 KB
/
Copy pathworkflow.json
File metadata and controls
63 lines (63 loc) · 1.52 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
{
"name": "csv-to-api",
"description": "Parse a CSV file to JSON via script, then POST the parsed rows to an API endpoint.",
"category": "data",
"features": ["shell", "http", "workflow.log"],
"input_schema": {
"type": "object",
"required": ["csv_path", "api_url"],
"properties": {
"csv_path": {
"type": "string",
"description": "Path to the CSV file to process"
},
"api_url": {
"type": "string",
"description": "API endpoint to POST the parsed data to"
}
}
},
"definition": {
"timeout": "10m",
"on_timeout": "fail",
"steps": [
{
"id": "parse-csv",
"type": "action",
"action": "shell.exec",
"params": {
"command": "python3",
"args": ["scripts/parse_csv.py", "${{inputs.csv_path}}"]
},
"timeout": "30s"
},
{
"id": "upload-data",
"type": "action",
"action": "http.post",
"depends_on": ["parse-csv"],
"params": {
"url": "${{inputs.api_url}}",
"body": {
"row_count": "${{steps.parse-csv.output.stdout.count}}"
}
},
"timeout": "30s",
"retry": {
"max": 2,
"backoff": "exponential",
"delay": "1s"
}
},
{
"id": "log-summary",
"type": "action",
"action": "workflow.log",
"depends_on": ["upload-data"],
"params": {
"message": "CSV upload complete"
}
}
]
}
}