-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkflow.json
More file actions
87 lines (87 loc) · 2.32 KB
/
workflow.json
File metadata and controls
87 lines (87 loc) · 2.32 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
85
86
87
{
"name": "image-processing",
"description": "Verify a source image exists, hash it for tracking, copy to output, and upload metadata to a CDN.",
"category": "media",
"features": ["fs", "crypto", "http"],
"input_schema": {
"type": "object",
"required": ["source_path", "output_path", "cdn_upload_url"],
"properties": {
"source_path": {
"type": "string",
"description": "File path to the source image"
},
"output_path": {
"type": "string",
"description": "File path to write the processed image"
},
"cdn_upload_url": {
"type": "string",
"description": "CDN upload API endpoint"
},
"max_width": {
"type": "integer",
"description": "Maximum width in pixels for resizing (default: 1200)"
},
"quality": {
"type": "integer",
"description": "Compression quality 1-100 (default: 85)"
}
}
},
"definition": {
"timeout": "3m",
"on_timeout": "fail",
"steps": [
{
"id": "read-source",
"type": "action",
"action": "fs.stat",
"params": {
"path": "${{inputs.source_path}}"
}
},
{
"id": "hash-source",
"type": "action",
"action": "crypto.hash",
"depends_on": ["read-source"],
"params": {
"algorithm": "sha256",
"data": "${{steps.read-source.output.path}}"
}
},
{
"id": "copy-to-output",
"type": "action",
"action": "fs.copy",
"depends_on": ["read-source"],
"params": {
"src": "${{inputs.source_path}}",
"dst": "${{inputs.output_path}}"
}
},
{
"id": "upload-cdn",
"type": "action",
"action": "http.post",
"depends_on": ["copy-to-output", "hash-source"],
"params": {
"url": "${{inputs.cdn_upload_url}}",
"body": {
"file_path": "${{inputs.output_path}}",
"original_size": "${{steps.read-source.output.size}}",
"source_hash": "${{steps.hash-source.output.hash}}",
"source_path": "${{inputs.source_path}}"
}
},
"timeout": "30s",
"retry": {
"max": 2,
"backoff": "exponential",
"delay": "2s"
}
}
]
}
}