Trigger Event when month changes

Helloooo

So. I am wanting to reset a data field (number) to 0 - when the month changes.

I think with my scenario, this should work…

BUT in the unlikely event that a user Posts something right at the first second of the new month… the workflow may not register?..

Does anyone know a better way to trigger a workflow as soon as the month changes? I don’t know how to use the (+)month - syntax…

ok, I’m a little confused by your explanation, but I think I get it: you have a list of Posts and you’re using the top one’s creation date as comparison with the current date to trigger this workflow.

Why not anchor the comparison date another way? Create a thing to store the date every month, and then compare your Current Date/Time:formatted as March with that thing’s date?

Thanks! That’s exactly right - I’m referencing the most recent post’s, creation date.

I think, though, if i store a date, in isolation (for the sake of comparing it to the Current Date/Time:formatted as March) - that date would have to be fixed…

If the Current Date/Time:formatted as March AND the “thing storing the date” are both dynamic; then they would register April at the same time - and there would be nothing definitive to trigger the workflow.

If I stored a fixed date as March 31.
I could say: when current date time > “stored date” = trigger workflow.
but then I would have to change the date manually for it to apply to the end of April and all subsequent months.

I guess ideally what I am looking for is a sequence that says something like:
When current date/ time, switches forward 1 month = trigger workflow
-because I don’t really even need to reference any user or content data, I just have to figure out how to best acknowledge the “new month”

I could be overthinking though! I will brainstorm with your suggestion

Forgot to say that you could schedule an API workflow to first do the reset and then update the stored date (in that order), so you don’t have do it manually. You’d have the stored date = current date condition as just an extra check on the conditions, it’s not really necessary.

I haven’t done a scheduled API workflow myself but I think others have found success (not sure what account plan you’re on or if that matters either):

Also with your initial solution, consider the scenario where you only have one March post at the top (with March still being the current month), then it somehow gets deleted. Then your workflow is going to get triggered again, even though you already ran it (if this is a workflow that isn’t manually triggered).

Your other solution (when current date time > store date = trigger workflow) also doesn’t look ideal, wouldn’t you be triggering your workflow multiple times then, unless you are are manually triggering this?

2 Likes

Ya your right, the current date/time > store date - is definitely not the way to do it.

As for only having one March post, that’s a good/fair observation. (that being said; if I only have one post in a given month, I have bigger problems haha! :smile:)

Thanks for you help - I’ll check that forum post. I have not done API workflows either…

Cheers,

I would be very tempted to use Zapier to schedule your API workflow, as it has all the front end done for you, and you get some feedback when it runs/doesn’t run.

Test it first with a button on an admin page, then run via Zapier.

3 Likes

Awesome, I’ll check that out! Thanks.

I haven’t used Zapier yet. That looks a great way to do it.