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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
{
"id": "complete_workflow",
"name": "Complete Workflow Example",
"description": "Demonstrates fetch -> enrich -> validate flow",
"condition": { "==": [true, true] },
"tasks": [
{
"id": "fetch_user_data",
"name": "Fetch User Data",
"description": "Get user data from a public API",
"condition": { "==": [true, true] },
"function": {
"name": "http",
"input": {
"url": "https://jsonplaceholder.typicode.com/users/1",
"method": "GET",
"headers": {
"Accept": "application/json"
}
}
}
},
{
"id": "initialize_user",
"name": "Initialize User Structure",
"description": "Create empty user object in data",
"condition": { "==": [true, true] },
"function": {
"name": "map",
"input": {
"mappings": [
{
"path": "data",
"logic": { "preserve": {"user": {}} }
}
]
}
}
},
{
"id": "transform_data",
"name": "Transform Data",
"description": "Map API response to our data model",
"condition": { "==": [true, true] },
"function": {
"name": "map",
"input": {
"mappings": [
{
"path": "data.user.id",
"logic": { "var": "temp_data.body.id" }
},
{
"path": "data.user.name",
"logic": { "var": "temp_data.body.name" }
},
{
"path": "data.user.email",
"logic": { "var": "temp_data.body.email" }
},
{
"path": "data.user.address",
"logic": {
"cat": [
{ "var": "temp_data.body.address.street" },
", ",
{ "var": "temp_data.body.address.city" }
]
}
},
{
"path": "data.user.company",
"logic": { "var": "temp_data.body.company.name" }
}
]
}
}
},
{
"id": "validate_user_data",
"name": "Validate User Data",
"description": "Ensure the user data meets our requirements",
"condition": { "==": [true, true] },
"function": {
"name": "validate",
"input": {
"rules": [
{
"path": "data",
"logic": { "!!": { "var": "data.user.id" } },
"message": "User ID is required"
},
{
"path": "data",
"logic": { "!!": { "var": "data.user.name" } },
"message": "User name is required"
},
{
"path": "data",
"logic": { "!!": { "var": "data.user.email" } },
"message": "User email is required"
},
{
"path": "data",
"logic": {
"in": [
"@",
{ "var": "data.user.email" }
]
},
"message": "Email must be valid format"
}
]
}
}
}
]
}