Select to view content in your preferred language

Execute Notebooks hosted in ArcGIS Online using ArcGIS API for Python

5788
14
05-04-2022 02:38 AM
ConradSchaefer__DOIT_
Regular Contributor

We have notebooks in AGOL that we would like to trigger remotely using the API for Python. It appears to be a possibility if you have your own Notebook Server but it doesn't look like the functionality exists for AGOL. See the arcgis.gis.nb.NotebookManager execute_notebook() function which says "The Execute Notebook operation allows administrators to remotely run a notebook in their ArcGIS Notebook Server site"

The times we want to run our notebooks are not on a regular schedule so the task functionality in AGOL is not appropriate. The run events are customer driven and on an unpredictable schedule, and turning the notebook over to them would not be appropriate. We would like to be able to be able to run a local python script that uses the API to trigger the Notebook to execute in AGOL.

 

@SusanHmel__DOIT_ 

14 Comments
TD1
by

@AndrewChapkowski @GLCAdmin @RichardHowe I don't see this functionality in AGOL. Can we please get this implemented in AGOL ASAP. I agree with @ConradSchaefer__DOIT_ and I need it as well. This still requires another machine to run this and we are already paying for AGOL and notebooks.

RichardHowe

@TD1 Did you look at the guidance I linked to, which gives you the python command to be able to trigger a notebook that sits in AGOL?

That's what @ConradSchaefer__DOIT_ was asking for I believe. If you simply wanted to trigger the notebook from inside AGOL you could just open it and run it. I'm struggling to see a third way

TD1
by

@RichardHowe Yes but that python needs to still be triggered more often than 15 minutes or on demand. Can you think of a way to do this without needing to put it on my server or my PC? Maybe something on AGOL or a webhook thru make.com?

RichardHowe

Ah ok, I see. Two workarounds I guess:

1. You put a repeat in the note book of the same bit of code in a while loop executing how often you wanted it to.

2. You copy the same notebook a few times over and stagger them

I can't see ESRI giving you an out of the box way to get around a schedule that they hard-coded into the notebooks. Might be better putting an ArcGIS idea in to suggest allowing more frequent runs e.g. every minute. It's also worth pointing out that if the notebook hadn't completed before the next one is due to start it will just skip that run and jump to the next one.