Automation Management
Update, enable, disable, and delete automations after they are created.
note
The userInstance refers to ESPRMUser from User Sign in.
What This Module Does ?
List, inspect, and change existing automations via ESPAutomation instances and user-level queries.
Use this after Automation creation—for toggling, editing events/actions, or deleting.
Not for creating automations — see Automation.
Expected outcome: Automations are updated, enabled/disabled, or removed without recreating them.
Common Workflows
Fetch, disable, update, re-enable
const automation = await userInstance.getAutomationDetail("automation_id");
await automation.enable(false);
await automation.updateName("Updated name");
await automation.enable(true);
List all automations
let response = await userInstance.getAutomations();
while (response.hasNext) {
response = await response.fetchNext();
}
Partial update
await automation.update({
name: "Updated name",
enabled: true,
events: [/* ... */],
actions: [/* ... */],
});
Granular helpers
await automation.updateName("New name");
await automation.updateEvents(events, "and");
await automation.updateActions(actions);
await automation.setRetrigger(true);
Delete
await automation.delete();
Error Handling
try {
const automation = await userInstance.getAutomationDetail(automationId);
await automation.update({ enabled: false });
} catch (error) {
console.error("Automation management failed:", error);
}
update() requires at least one field.
Advanced Concepts
Management workflow
Best Practices
- Disable before large edits
- Use granular helpers for single-field changes
- Paginate long automation lists
- Confirm before delete
Related Resource
- API Reference: