-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkflow.json
More file actions
84 lines (84 loc) · 2.17 KB
/
Copy pathworkflow.json
File metadata and controls
84 lines (84 loc) · 2.17 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
"name": "data-anonymizer",
"description": "Read a dataset file, hash specified PII fields using crypto.hash, and copy the result to output.",
"category": "data",
"features": ["fs", "loop", "crypto"],
"input_schema": {
"type": "object",
"required": ["input_path", "output_path", "pii_fields"],
"properties": {
"input_path": {
"type": "string",
"description": "Path to the input JSON dataset file"
},
"output_path": {
"type": "string",
"description": "Path to write the anonymized output"
},
"pii_fields": {
"type": "array",
"description": "List of field names to anonymize (e.g. ['email', 'name', 'phone'])",
"items": { "type": "string" }
}
}
},
"definition": {
"timeout": "5m",
"on_timeout": "fail",
"steps": [
{
"id": "read-data",
"type": "action",
"action": "fs.stat",
"params": {
"path": "${{inputs.input_path}}"
},
"timeout": "15s"
},
{
"id": "hash-fields",
"type": "loop",
"depends_on": ["read-data"],
"config": {
"mode": "for_each",
"over": "inputs.pii_fields",
"max_iter": 50,
"body": [
{
"id": "hash-field",
"type": "action",
"action": "crypto.hash",
"params": {
"algorithm": "sha256",
"data": "${{loop.item}}"
},
"timeout": "5s"
}
]
}
},
{
"id": "log-anonymized",
"type": "action",
"action": "workflow.log",
"depends_on": ["hash-fields"],
"params": {
"message": "PII fields hashed successfully",
"input_path": "${{inputs.input_path}}",
"output_path": "${{inputs.output_path}}"
}
},
{
"id": "write-output",
"type": "action",
"action": "fs.copy",
"depends_on": ["log-anonymized"],
"params": {
"src": "${{inputs.input_path}}",
"dst": "${{inputs.output_path}}"
},
"timeout": "15s"
}
]
}
}