Event: Delete Node

The Event: Delete Node allows a workflow to delete one or more Events from your application.

Event: Delete Node

Node Properties

The configuration for the Event: Delete Node requires a query method and parameters to find the Event(s) to delete. First, choose if you would like to delete one event by ID, or multiple Events by query.

Delete One Event by ID

When choosing “One event by ID …” as the “Delete Mode”, you must provide an ID of one of your application’s Events, or more likely, a template that resolves to one of your application’s event’s IDs.

Delete One Event by Query

When choosing “One event by query…” you must provide a valid event query to select which Event to delete.

By default, this query returns the most recently createdEvent in a “resolved” state.

Delete Multiple Events By Query

When choosing “Multiple events by query …”, you must provide a valid event query for selecting which Events to delete. By default, this query returns all Events in a “resolved” state.

Result Path

Optionally, you may store the result of the operation at a path on your payload.

Node Example

If the node executed successfully and you set a Result Path in the node’s configuration, the following object will be added to your payload at the defined path:

{
  "count": 42, // the number of Events that were deleted
  "success": true // always set
}

Notes

  • Deleting no Events – for example, when deleting multiple Events by query and the query returns no Events – still counts as a successful node execution. In this case the count property will be 0.
  • The success property will always be present and its value will always be true.
  • Unlike when modifying multiple Events in the Event: Update Node — which queues the updates to happen some time in the near future — deletions take effect immediately.

Node Errors

If the node errors, the workflow will continue onto any nodes connected to this node’s output. There are two common cases where the node will fail to execute and will return an error object:

Not Found

When deleting one event by ID, if no event with that ID exists within your application (usually when providing a template that does not resolve to a valid ID), the node’s result will be:

{
  "error": {
    "message": "Event was not found",
    "type": "NotFound"
  }
}

Validation

When deleting multiple Events by query, if the provided query is not a valid event query (such as when using templates that do not resolve to valid values), the node’s result will be:

{
  "error": {
    "message": "[value] is not a valid value for [property]",
    "type": "Validation"
  }
}

Was this page helpful?


Still looking for help? You can also search the Losant Forums or submit your question there.