Implementation

You can create, configure, modify, and delete cron jobs from the console. The implementation section covers steps to work with cron from the console.

Note: Catalyst allows up to 500 cron executions per project per day in the development environment. You can request Catalyst for an increase in this limit by contacting our support at support@zohocatalyst.com. We will address each request on a case-by-case basis. There are no upper limits for cron execution in the production environment.

Create a Cron

To create a Catalyst cron in your project from the console:

  1. Navigate to Cron under the Triggers section in the Catalyst Cloud Scale console.

  2. Click Create Cron.
    catalyst_cron_empty

  3. Enter the cron’s name and an optional description in the Create Cron section.
    catalyst_cron_name_des

Third-party URL

If you choose to invoke a third-party URL for the cron:
catalyst_cron_schedule_point_thirdparty_config

  • Enter the Target URL.

  • Select the HTTP request method to invoke the URL with, from the drop-down list.

  • Enter the Header Name and Header Value. To add more headers, click (+) and add the next header. To delete a header, click (-).

  • Add URL parameters to be passed, if needed, by entering their names and values. To add more parameters, click (+) and add the next parameter. To delete a parameter, click (-).

  • To include an optional request body, enter the form data that you want to be passed in the HTTP message body.

Function

If you choose to call a function for the cron:
catalyst_cron_schedule_point_function_config

  • Select the Target Function from the drop-down list. The list will only display the cron functions configured in your project, and not other types of functions.

  • Add function parameters to be passed, if needed, by entering their names and values.

  • To add more parameters, click (+) and add the next parameter. To delete a parameter, click (-).

Circuit

If you choose to trigger a circuit:
catalyst_cron_trigger_circuit_json_input

  • Select the Target Circuit from the drop-down. The list will display all the circuits you have configured in the Serverless section of the console.
Note: If you have not created any circuit prior to creating your cron, click the Create New button in the drop-down. You will be directed to the Circuits component, and you can create a new cricuit.
  • Pass the input to the associated circuit as JSON key-value pairs in the JSON Input for Circuit section.

  1. Select the Schedule Type of the cron as One Time or Recursive.

One-time execution

catalyst_cron_schedule_type_onetime_config

  • Select the schedule date the cron must be executed on, from the calendar.

  • Configure the hour, minute, and second from their drop-down lists.

  • Choose the time zone of the execution. The cron will be executed on the configured time in that time zone.

Note: You can configure the cron's time zone independently from the project's time zone that you set under the General Settings.

Recursive

  • Select the Repeat Type for a recursive cron from the drop-down list as Every, Daily, Monthly, or Yearly. catalyst_cron_all_recursive_types

  • If you select the Repeat Type as Every, configure the hours, minutes, and seconds of the time from the drop-down lists to specify the frequency. The cron will be executed once every specified time interval. For example, in the screenshot below, the cron will be executed once every hour. catalyst_cron_schedule_type_recursive_every

  • If you select the Repeat Type as Daily, configure the hours, minutes, and seconds of the time period for the cron to execute. The cron will be executed everyday at the specified time. catalyst_cron_schedule_type_recursive_daily

  • If you select the Repeat Type as Monthly, you can choose to schedule the cron’s execution by the date of the month or by the week of the month, to be executed on a specified day.

    • Select Day if you want to schedule the cron’s execution by the date of the month. Click on all the dates of the month the cron must be executed on, from the calendar. catalyst_cron_recursive_monthly_day

    • Select Week if you want to schedule the cron’s execution by the week of the month. Click the Select Week tab and choose the week from the drop-down list. Click the Select Day tab and select the day the cron should be executed on from the drop-down list. catalyst_cron_recursive_monthly_weekly

    • After you select the days, configure the time for the cron to be executed on from the Hours, Minutes, and Seconds drop-down lists. catalyst_cron_recursive_monthly_3

    • If you select the Repeat Type as Yearly, select all the months the cron must be executed on, from the Months drop-down list. catalyst_cron_recursive_yearly

    After you select the months, you can schedule the cron’s execution by the date of the month or by the week of the month, as mentioned in the previous step. You can then configure the time in the same way as the previous step.

  1. After you configure all the details, click Save.

Catalyst will now display the cron job in the Cron page along with its details. A unique Cron ID is automatically created for a cron when it is created, and displayed in the details. You can refer to a cron by its ID in your application code.
catalyst_cron_viewcron

You can click on a cron to view further details about it.
catalyst_cron_dets

Configuring Alerts in Cron

You can configure application alerts for the events where your cron may encounter a failure, code exception, or time out. You can configure email alerts from the cron console without having to navigate to the Application Alerts component.

  1. Click +Configure in the cron’s details section to create an alert.
    catalyst_cron_create_alert

  2. Click Confirm once you configure the application alert. You can refer to the Application Alerts help page for details.
    catalyst_cron_cofinguration_alert

  3. You can also delete the application alert by clicking the ellipsis icon beside the alert status and clicking Remove.
    catalyst_cron_delete_alert

Enable or Disable a Cron

You can temporarily enable or disable a cron job using the toggle switch under the Status column. If you disable a cron, Catalyst will not trigger its execution until you manually enable it again.
catalyst_cron_status


Note: If a cron associated with a third-party URL fails in its executions 50 times in a row, Catalyst will automatically disable it. You can configure Application Alerts to automatically notify you whenever a cron's execution fails. You can then check the cron's execution history from the console and perform the required bug fixes. Cron jobs associated with cron functions will not be disabled automatically irrespective of repeated failures.

Cron Execution History

You can view the history and details of a cron’s execution from its Execution History. Click the icon under the History column for a cron to open its execution history.
catalyst_cron_execution_hisotry

Catalyst displays the execution log of all cron job executions in your project. This contains detailed information about the cron job, such as the Execution ID, the start and end time, the execution time, the executive status, and links to Catalyst Logs.
catalyst_cron_execution_history

You can click View Logs to check detailed logs about the corresponding cron function’s execution.

You can also filter and view the execution history based on the status of the cron job.

catalyst_cron_status_filter

You can select a specific time and also the time zone of the cron execution to view its particular execution history.

cron_choose_timezone

Note: Catalyst retains the execution history of a cron job for 15 days in the development environment, and 30 days in the production environment.

Edit a Cron

To edit a configured cron:

  1. Open the cron that needs to be edited from the Cron page.

  2. Click Edit in its details page.
    catalyst_cron_edit_cron

  3. Make the necessary changes, then click Save.
    catalyst_cron_edit_save_cron

Delete a Cron

To delete a cron permanently:

  1. Click the ellipsis icon for the cron that needs to be deleted, then click Delete.
    catalyst_cron_delete_select

  2. Click Yes, Proceed to confirm the delete.
    catalyst_cron_delete_popup


Last Updated 2023-12-15 18:54:08 +0530 +0530