Work with functions

Best practices and considerations when working with functions using the Skedulo CLI.

Overview

Connected functions are server extensions in Skedulo that make it possible to integrate with 3rd-party systems and use custom code to implement organization-specific functionality. For example, connected functions can be used to update records based on triggers, send SMSs, or connect with other software systems to get or send data.

Connected functions are used in any scenario where additional backend functionality is required within the Skedulo product to achieve the rapid development of new features on the platform and in the mobile application.

Skedulo CLI commands for connected functions

The CLI commands are grouped into logical groups, or topics, for ease of use. The commands relevant to connected functions are listed in the table that follows.

CLI command Description
$ sked function dev Set up a local development connected function.
$ sked function generate Generate a connected function template.
$ sked artifacts function upsert Create or update a function from a state file and bundle folder. This command replaces the deprecated create and update commands.
$ sked artifacts function delete Delete a connected function.
$ sked artifacts function get Get the state of a connected function.
$ sked artifacts function list Get a list of all existing functions.
$ sked logs function Fetch a function’s execution logs. Skedulo CLI Studio’s log viewer opens the same view interactively.

View function logs

A connected function runs on Skedulo’s servers, not on your machine, so you cannot attach a local debugger to it. sked logs function fetches that function’s execution log for a time range, so you can inspect requests, errors, and console output instead of waiting on a separate dashboard. Use sked logs tail --artifact function instead to watch new entries as they arrive.

You can deploy a change, trigger it, and see the result in the same window, instead of switching to a separate dashboard to check what happened. Use it to confirm a fix during local development, or to diagnose a failure a customer reports in production.

Run sked logs function with a function name to fetch its logs, or launch Skedulo CLI Studio and open the log viewer for a scrollable session with full detail on each entry.

See also

See the function documentation for background, the sked function dev and sked function generate references for local development, the sked artifacts function reference for retrieving and deploying functions, and the sked logs function reference for fetching its execution logs.