Description
The suspend action type is fully supported at runtime (runJobAction_suspend() in lib/action.js), but the API input validation in validateActionData() (lib/api.js ~line 468) rejects it as an unknown type. This prevents creating or updating events with suspend actions via the API (create_event/v1, update_event/v1), even though they work correctly when configured through the UI.
Steps to Reproduce
curl -X POST http://localhost:3012/api/app/create_event/v1 \
-H "X-API-Key: YOUR_KEY" \
-d '{
"title": "Test Suspend",
"enabled": true,
"category": "general",
"targets": ["main"],
"plugin": "shellplug",
"params": { "script": "echo hi" },
"actions": [
{ "type": "suspend", "condition": "start", "enabled": true }
]
}'
Expected: Event created successfully.
Actual: Returns error: "Unknown type"
Root Cause
The validateActionData() method in lib/api.js has a switch statement that enumerates recognized action types (email, web_hook, run_event, channel, store, fetch, plugin, disable, delete). The suspend type is missing from this list, so it falls through to the default case which returns "Unknown type".
The runtime engine handles suspend actions correctly — runJobAction_suspend() in lib/action.js exists and works. The validation is simply out of sync with the runtime.
Suggested Fix
Add case 'suspend': to the action type validation switch in lib/api.js:
case 'suspend':
// suspend action - pauses job for manual approval
break;
Description
The
suspendaction type is fully supported at runtime (runJobAction_suspend()inlib/action.js), but the API input validation invalidateActionData()(lib/api.js~line 468) rejects it as an unknown type. This prevents creating or updating events with suspend actions via the API (create_event/v1,update_event/v1), even though they work correctly when configured through the UI.Steps to Reproduce
Expected: Event created successfully.
Actual: Returns error:
"Unknown type"Root Cause
The
validateActionData()method inlib/api.jshas a switch statement that enumerates recognized action types (email,web_hook,run_event,channel,store,fetch,plugin,disable,delete). Thesuspendtype is missing from this list, so it falls through to thedefaultcase which returns"Unknown type".The runtime engine handles suspend actions correctly —
runJobAction_suspend()inlib/action.jsexists and works. The validation is simply out of sync with the runtime.Suggested Fix
Add
case 'suspend':to the action type validation switch inlib/api.js: