Scheduling Functions

Find out about scheduling functions that you have created with OCI Functions.

You can run the functions that you create with OCI Functions on a recurring schedule using resource schedules. Scheduling functions to run at the same time each week, day, or hour enables you to automate some of the tasks associated with managing cloud infrastructure, such as:

  • Maintenance and Housekeeping: Schedule functions to perform regular maintenance tasks. For example, database cleanup, log rotation, data archiving, cleanup of expired sessions in an application's cache, and monthly archiving of audit logs to long-term storage.
  • Periodic Data Processing and Analytics: Run data processing or analytics jobs at set intervals. For example, to generate daily reports, to update dashboards, to aggregate sensor data every hour for trend analysis, and to process batched data on a schedule that meets business requirements.
  • Machine Learning and AI: Schedule model retraining with new data to improve accuracy and performance. For example, by running periodic inference tasks at scheduled times to generate predictions or recommendations, by evaluating model performance daily and monitoring key metrics to detect drift, and by triggering alerts if performance drops below thresholds.

You schedule a function by creating a new resource schedule, and adding the function to that resource schedule. You can add additional functions to the same resource schedule later. The resource schedules you create are stored in OCI Resource Scheduler (for more information, see About Resource Scheduler).

You can create resource schedules and add functions to them using:

  • OCI Functions Console pages
  • Resource Scheduler Console pages
  • Resource Scheduler CLI
  • Resource Scheduler API

See Scheduling a Function.

Prerequisites

To create and use resource schedules in Resource Scheduler, you must have been granted permission to manage resource schedules in the tenancy. For example, by a policy statement similar to the following:

Allow group acme-functions-developers to manage resource-schedule-family in tenancy

Before a function can be invoked according to a resource schedule:

  • You have to create a dynamic group with a rule that includes the resource schedule's OCID. For example:
    ALL {resource.type='resourceschedule', resource.id='ocid1.resourceschedule.oc1.phx.amaaaaaa3______owq'}
  • You have to create a policy statement that grants the dynamic group access to the function. For example:
    Allow dynamic-group resource-scheduler-prod-dynamic-group to manage functions-family in tenancy

For more information, see Creating Schedules in the Resource Scheduler documentation)..