Documentation
Welcome to docs|Reactions|Canceling scheduled reactions

Canceling scheduled reactions

This page describes how you cancel scheduled reactions in Serialized.

Reactions that are pending (to be executed in the future) or waiting for a retry attempt can be canceled. You can cancel reactions either using the SDKs, the API or the Console.

Canceling a reaction

To cancel a reaction you need to know the reaction ID. You can find the reaction from the Console or by using the SDKs to list reactions by status.

The following example shows how you can cancel a reaction with the ID a3b8f2d0-5d5c-4d8e-8f8d-4f8d33f7d48f using our SDKs.

UUID reactionId = UUID.fromString("a3b8f2d0-5d5c-4d8e-8f8d-4f8d33f7d48f");reactionClient.deleteReaction(deleteReaction(reactionId).build());
const reactionId = 'a3b8f2d0-5d5c-4d8e-8f8d-4f8d33f7d48f'await reactionsClient.deleteReaction({reactionId});

Canceling multiple reactions

To cancel multiple reactions you must first find the reactions you want to cancel. You can do this by using the SDKs to list reactions by status. After you have the list of reactions you want to cancel, you can cancel them using the same operation as for deleting a single reaction.

Below is an example of how you can cancel all scheduled reactions with the reaction name notify-on-order-placed. The example uses the SDKs to list all scheduled reactions and then filter out all reactions matching the reaction name that is provided.

var request = listReactions().withStatus(Reaction.Status.SCHEDULED).build();reactionClient.listReactions(request)        .reactions()        .stream()        .filter(reaction -> reaction.reactionName().equals("notify-on-order-placed"))        .map(Reaction::reactionId)        .forEach(reactionId -> reactionClient.deleteReaction(deleteReaction(reactionId).build()));
const request = {status: 'SCHEDULED'}await reactionsClient.listReactions(request);    listReactionsResponse.reactions        .filter(r => r.reactionName === 'notify-on-order-placed')        .map(reaction => reaction.reactionId)        .forEach(reactionId => (reactionsClient.deleteReaction({reactionId})));