Running a module at the end of the run of a scenario or of another module

Hi there,

I’m trying to find emails in a folder, and if criteria match (one of them is “unread”), do something. If criteria don’t match, mark as read.
The issue with this is that emails that don’t match, can’t get marked as read because they are essentially ignored. So I tried to use another module that just looks at unread emails and marks them all as read. The issue is that I need this to run once, and ideally at the end of the scenario because otherwise, it marks all emails as read and the scenario no longer works as all subsequent emails in that folder are now marked as read.

So the best way to solve this would be to run this module once only, and once the other email search module has run its course (currently 70 searches or so but it may vary), oronce the entire scenario has completed, as a last action that happens regardless of anything else.

Is there a way to achieve this?
Thanks!

Welcome to the Make community!

You could immediately mark them all as read first instead at the end of the scenario.

Alternatively, you should create filters in Gmail and move them to specific labels which you monitor.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

To allow us to assist you with your scenario, please provide the following:

1. Relevant Screenshots

Please share screenshots of your scenario, any error messages, relevant module fields, and filters in question? It would really help other community members to see what you’re looking at.

You can upload images here using the Upload icon in the text editor:

2. Scenario Blueprint

Please export the scenario blueprint file to allow others to view the mapped variables in the module fields. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

3. Output Bundles of Modules

Please provide the output bundles of the modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.

A. Upload as Text File

Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

B. Insert as Formatted Code Block

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles.
These are the two ways to format text so that it won’t be modified by the forum:

  • Method 1: Type code block manually

    Add three backticks ``` before and after the content/bundle, like this:

    ```
    content goes here
    ```

  • Method 2. Highlight and click the format button in the editor

Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

Hi @samliew, thank you for your help.
Unfortunately, I don’t think your proposed solutions would help in that instance.
As per my message, the filter includes that the email is unread. So marking the emails as read first would just ensure that all emails are ignored.
Regarding your second suggestion, I do not see how this would be any different than marking them as read, because the issue is not the action that I want to take, it is the fact that if an email does not get picked up by the filter, then the module returns an empty output.

Blueprint attached
blueprint.json (28.8 KB)

Thanks,
Arnaud