Skip to main content

It is already possible to execute data jobs and data models. But I have not found anything for schedules in PyCelonis Docs. The reason I want to do this is to distinguish between an automatic execution via DI/Python schedule or a true manual one with a "real" user behind.

 

If I execute a data job via Python, it will be shown as "Manual Execution" in the logs.

 

Best regards

Irfan

Dear @irfan.suria12 , you may check Data Job Execution API (celonis.com) . There are few API available under Data Integration (celonis.com).

 

Hope it works!


Hi @Teuku Faruq , you are referring to a Data Job Execution API. However, I am looking for a Schedule execution API. Any hints?


Hello Irfan, sorry when answering in my mind I was thinking you would like to schedule it your own through python by reading Data Job Execution.

 

Btw I dont think Celonis expose their schedule API publicly right now, I dont have any further info.


Hi, there's no separate schedule API., however you can try to reverse engineer that.

 

Select specific schedule, and exectue looking at specific request that browser sends when executing schedule. In my test environment I've got schedule ID called "Normal schedule", if I'll go into settings i can retrive URL:

 

https://accenture-hackathon-app-2.try.celonis.cloud/integration/ui/pools/aa6a0d78-6115-4e4e-88f6-4331f77b39e3/advanced-settings/scheduling/280edc5b-d5d7-4560-b850-4661a86b7c84

 

As you can see you can modify that URL to match one below on screenshots that mimics user action to trigger action flow. Probably you can also change things like execution hour/date. If you be able to change execution time to be few minutes ahead of schedule change, it should be considered automatic., but trigger by python.

 

obraz.png 

If you've got https request ready you can use requests library or api_request() (availble only in PyCelonis versions below 2.00 like 1.7.6 and lower).

 

https://celonis.github.io/pycelonis/1.7.6/reference/celonis_api/celonis/#celonis_api.celonis.Celonis.api_request

 

Hope that helped, let us know if that worked! :)

 

Best Regads,

Mateusz Dudek


Hi Mateusz, it works like a charm! Thank you so much for the hint! 🙂 Happy Holidays and a prosperous New Year!


Hi Irfan,

 

Glad to hear that! Also wishing you happy holidays and a happy new year! :)

 

One question, is just executing a schedule as mentioned above is considered as a automatic triggering, or you needed to change execution date and just "let it run"? I didn't have time to test it out and the outcome would be interesting.

 

Best Regards,

Mateusz Dudek


I keep the schedule disabled and only trigger it from the python script. So the scheduling plan in the schedule itself is redundant. By executing the schedule via api_request in python, the execution will be automatically shown under the schedule name instead of Manual Execution. However, you might need to connect to the Celonis API with an App key instead of a User key

image


Reply