Skip to main content
Question

Trigger automation to run once at a specified time


ebygomm
Influencer
Forum|alt.badge.img+32

I want a workspace to run on FME Flow at 11pm with a user initiating it at some point within the working day.

Currently thinking of having the workspace run within an automation, which is scheduled to run daily at 11pm. User would enable the automation, workspace would run at 11pm and then trigger a second workspace which makes a http call to stop the automation. So the workspace is only run once and won’t run again until the process is repeated.

Any ideas of a better way to do this?

7 replies

birgit
Influencer
Forum|alt.badge.img+16
  • Influencer
  • March 28, 2025

I did something once with a classic schedule. I had an existing inactive schedule that would run once 5 minutes after it was activated and I used a workbench to activate it, the schedule would then run the next workbench. That way I didn't have to deactivate anything.

 

Another nice thing was that I could use my first workbench to check if the schedule was already activated. This way you can run a workbench once a day even though maybe multiple people activated it. Nice for slow processes that just update a complete dataset or something like that.


redgeographics
Celebrity
Forum|alt.badge.img+49

The /schedules endpoint of the API supposedly offers a way to run a schedule only once at a specified time. So I guess if you put that API call in a webhook you don't need the second workspace at all.


ebygomm
Influencer
Forum|alt.badge.img+32
  • Author
  • Influencer
  • March 28, 2025

I can’t see any API call that allows a specified time run? I looked at automations and schedules and I can only see trigger an immediate run


redgeographics
Celebrity
Forum|alt.badge.img+49

Like I said; supposedly (that's what the explanation says anyway). I guess you need to set start- and end-times and an interval still


birgit
Influencer
Forum|alt.badge.img+16
  • Influencer
  • March 28, 2025

What I did with my schedule is I already set it on the correct time in the schedule itself, then I just activate it with the API through what I think was an http caller. It might be good t know that this was on an old version of FME server where the capabilities of automations was still limited which is why i had to take this route.

 

In your case I would make the schedule with the correct time to start running with maybe a CRON statement and then set the schedule to run once. Set the schedule to inactive. Then use the automation to activate the schedule(or you can still use the way I did it with workbench->schedule->workbench method).

 

Edit:Oh wait i see what you mean now. You can't do it the way I wrote here. I will take a look if I can find my old schedule and workbench.


ebygomm
Influencer
Forum|alt.badge.img+32
  • Author
  • Influencer
  • March 28, 2025
redgeographics wrote:

Like I said; supposedly (that's what the explanation says anyway). I guess you need to set start- and end-times and an interval still

Ah, I’ve found it now, you effectively create a new schedule or amend an existing schedule with no recurrence with a begin time of when you want it to run, and an end time that is the same. I was looking for something that would trigger an existing schedule.

Moving away from schedules, so I think an api call to trigger the automation which will then shut itself off after running once is probably cleaner for me. 

Ideally, i’d want something so that i could manually trigger an automation at a future time. Just checking that something like that didn’t already exist.


birgit
Influencer
Forum|alt.badge.img+16
  • Influencer
  • March 28, 2025

I found it, do keep in mind that this is probably an old FME rest API so watch out with copy pasting.

This is an example URL: $(FMEServerURL)/fmerest/v3/schedules/$(Repository)/$(ScheduleName)

And the body of the call:

{
  "request": {
    "publishedParameters": [],
    "TMDirectives": {},
    "NMDirectives": {
      "directives": [],
      "successTopics": [],
      "failureTopics": []
    }
  },
  "workspace": "MyWorkbenchIWantToRun.fmw",
  "description": "A random description",
  "repository": $(Repository),
  "skipUntilJobComplete": false,
  "enabled": true,
  "recurrence": "none",
  "name": $(ScheduleName),
  "end": "@Value(ScheduleDateTimeRounded)",
  "interval": 30,
  "category": "A Category",
  "begin": "@Value(ScheduleDateTimeRounded)"
}

Content type is application/json.

You can set your start time the same as your end time


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings