Skip to main content

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

  1. Disable before large edits
  2. Use granular helpers for single-field changes
  3. Paginate long automation lists
  4. Confirm before delete

On this page