Question

How can you dynamically schedule an automation, based on a user parameter?

  • 20 December 2021
  • 2 replies
  • 2 views

I'm trying to schedule a flow based on an end user's chosen start time (which they'd pick and submit via an FME Server app).

 

To do this, I've built two flows: one that takes all the parameters (including a scheduled start time) and has a server app built in front of it; and a second one that actually does the heavy lifting and is either called via a webhook or is scheduled by FME Server.

 

I've tried to be clever and set a HTTPCaller at the end of the first flow to initiate a new once-off schedule in FME Server, but it's always failing with this error message:

	"message": "Unauthorized request by user admin due to lack of proper permissions or the object does not exist."

Any ideas? Or even thoughts on better ways to do this?

 

image


2 replies

Userlevel 4
Badge +26

Your workflow here should work - I can't see any reason why it wouldn't. It will create a whole load of schedules though which might be a bit annoying. I guess you can always have another schedule to go and clean them up though - heh.

 

The message suggests that the token your using in the REST call doesn't have enough permissions, could it be this simple? Are you using a token or are use using the admin users credentials directly in the request?

 

You should also make sure that you are doing a POST request to create the schedule rather than a PUT or GET. A PUT or GET both assume the item already exists which could be where this message is coming from.

Userlevel 5
Badge +29

Your workflow here should work - I can't see any reason why it wouldn't. It will create a whole load of schedules though which might be a bit annoying. I guess you can always have another schedule to go and clean them up though - heh.

 

The message suggests that the token your using in the REST call doesn't have enough permissions, could it be this simple? Are you using a token or are use using the admin users credentials directly in the request?

 

You should also make sure that you are doing a POST request to create the schedule rather than a PUT or GET. A PUT or GET both assume the item already exists which could be where this message is coming from.

Re the token, assuming you've left the admin creds as default it should be a superuser and therefore have access to any/everything on the server. Could be that your request is referencing something that doesnt exist?

Reply