Skip to main content
Public Preview

RasterFlow workflows can be submitted as Job Runs using the Wherobots Runs REST API. This lets you run RasterFlow workflows as automated, standalone jobs outside of a notebook, which is useful for production pipelines, scheduled processing, and CI/CD integration.

Benefits

Running RasterFlow workflows as jobs provides several advantages over interactive notebook execution:
Schedule and trigger RasterFlow workflows programmatically.
Run workflows in a managed environment without interactive notebooks.
Incorporate RasterFlow into existing data pipelines and CI/CD systems.
Track job status and results through the Usage History page.

Before you start

Before submitting RasterFlow jobs, ensure you have the following:

Overview

Submitting a RasterFlow workflow as a job involves three steps:
  1. Write a job script: Create a standalone Python script containing your RasterFlow workflow
  2. Upload the script: Upload the script to Wherobots Managed Storage so it can be referenced by the Job Run.
  3. Submit the job: Submit the job using the Runs REST API

Write the job script

Create a Python script that contains your RasterFlow workflow. This script will be executed by the Wherobots Job Run environment. It should be self-contained—all imports, configuration, and processing logic must be included in the script. The following example runs the Fields of the World (FTW) model on Haskell County, Kansas using RasterFlow.
This is a subset of the code included in the Fields of the World solution notebook. See the FTW tutorial for more details on the model and its outputs.
rasterflow_ftw_job.py

Upload the script

Upload the job script to your Wherobots Managed Storage so it can be referenced by the Job Run. Your upload method will depend on where you created the script:
If you wrote and saved the job script (in this example rasterflow_ftw_job.py) in the Wherobots Cloud notebook environment, upload the job script to Managed Storage using s3fs.
  1. Start a Notebook Runtime in Wherobots Cloud.
  2. Paste the following code snippet into a notebook cell in the same directory as rasterflow_ftw_job.py.
  3. Run the cell to upload rasterflow_ftw_job.py. Go to Cloud Storage in the Wherobots Cloud interface to confirm that the file is uploaded to your Managed Storage.

Submit the job

Once rasterflow_ftw_job.py is uploaded to Managed Storage, submit it as a Job Run using the Runs REST API.
  1. Create the following environment variables:
    Never hardcode your API key in scripts or source code. Always load it from an environment variable or a secrets manager. The example below reads the key from the WHEROBOTS_API_KEY environment variable.
  2. Run the following script to submit a job that references your uploaded rasterflow_ftw_job.py.
    The submission script uses the requests library. If it is not already installed in your environment, install it with pip install requests.
    submit_rasterflow_job.py

Monitor the job

After submitting a job, you can monitor its progress in several ways:
  • Usage History: Use the Usage History page for a broader view of all workloads across your organization.
  • RasterFlow run detail page: Selecting a RasterFlow row in Usage History opens the run’s detail page. While the run is PENDING, QUEUED, or RUNNING, the page polls for status updates and shows a refresh button next to the status badge. If the run ends in FAILED, the page shows a support banner with an Email us button that opens a pre-addressed message to support@wherobots.com with the execution ID in the subject.
  • REST API: Query the job status programmatically using the Runs REST API.

Next steps

The following resources will help you further explore RasterFlow and its related capabilities:
See all available built-in models in RasterFlow Models.
Review all available parameters for the Runs REST API.
Set up automated pipelines with the Wherobots Apache Airflow Provider using the WherobotsRunOperator.
Learn about Runtimes to choose the right compute resources for your workflows.

API reference

For detailed RasterFlow API documentation, see:
RasterflowClient methods — see Client API Reference
Enums and configuration objects — see Data Models Reference
Error handling — see Exceptions Reference