Project Management
Currently, this section is specific to OpenFn/platform v1.
Jobs
This section of the portal allows you to create and manage your jobs.
Searching jobs
For a project with a number of jobs, finding a job can be easily achieved via the search feature.
To search for a given job:
- From the application menu, click on Jobs.
- Find the Search jobs box and type the name of the job in the search box.
- The application will filter and show all jobs matching the portion of text entered into the search box.
Switching on/off a job
In OpenFn, a job is off by default. To switch on a given job, follow the steps below:
- From the application menu, click on Jobs.
- Find the job you would like to turn on.
- On the top-right corner of the job card, click on the switch button to turn on/off the job.
- Once switched on, the job's switch button will change the color to blue.
Note that once a job is switched on, OpenFn will run it automatically, as configured. If you do not want a job to be run automatically, by OpenFn, then turn it off.
Making a job private
OpenFn allows you to share jobs to an open source job library that other users can learn from or reuse. All jobs are available for sharing and inherit project sharing settings, by default. If you do not want a given job to be available for sharing to OpenFn's Job Library, then you can mark that job as private. To mark a job as private, follow the below steps:
- From the application menu, click on Jobs.
- Find the job you would like to mark as private.
- On the bottom-left corner of the job card, click on the View.
- While on the details page for the selected job, click on the eye icon.
Note that once a job is marked as private, sharing will be blocked even if its project is enrolled in the OpenFn's Job Library. You can toggle this setting back by clicking on the eye icon.
Archiving a job
OpenFn allows you to archive a job if it is no longer needed or used. To archive a job, follow the steps below:
- From the application menu, click on Jobs.
- Find the job you would like to archive.
- On the bottom-left corner of the job card, click on the View.
- While on the details page for the selected job, click on the archive icon.
- Confirm archiving in the dialog that pops up after clicking the archive icon.
Note that once archived, the job won't appear in your jobs list. Also messages will not appear to match against it until you restore the job. Also note that a job cannot be deleted, it can only be archived.
Restore archived job
To restore an archived job, follow the steps below:
- From the application menu, click on Jobs.
- While on the jobs list page, click on the Show archived jobs button.
- All archived jobs will be shown in the jobs list.
- Find the job you would like to restore.
- On the bottom-left corner of the job card, click on the View.
- While on the details page for the selected job, click on the restore icon.
- The job will now be shown in the list of available jobs.
Disabling console logs for a job
OpenFn allows you to disable console.log statements for your job. Disabling
console.log ensures that sloppy or malicious code written in the job
expression does not expose sensitive data from the jobs.
To disable console.log for a given job, follow the steps below:
- From the application menu, click on Jobs.
- Find the job you would like to disable console log for.
- On the bottom-left corner of the job card, click on the View.
- While on the details page for the selected job, click on the lock icon.
Editing a job
OpenFn allows you to edit or make changes to existing jobs. To edit a given job, follow the steps below:
- From the application menu, click on Jobs.
- Find the job you would like to edit.
- On the bottom-left corner of the job card, click on the View.
- While on the details page for the selected job, click on the pencil icon.
- See details about job editing in Job Studio here.
Job change history and reverting changes
If your job is linked to a GitHub repo, changes made to a job expression can be reverted to a given git commit. To revert changes made to a job expression, follow the steps below:
- From the application menu, click on Jobs.
- Find the job whose changes you would like to revert.
- On the bottom-left corner of the job card, click on the View.
- While on the details page for the selected job, scroll down to the bottom of the job card and click on View Change History.
- Select a corresponding change history row.
- Accept the prompts to revert to a previous commit, in the revert dialog.
Note that after the revert dialog confirmation, the job expression will instantly be reverted to a selected commit. No other jobs will be reverted. To instantly revert all jobs in for a given project to a previous commit, resend the webhook from GitHub.
Creating a new job
To create a new job, follow the steps below:
- From the application menu, click on Jobs.
- Find a blue floating button with + icon, and click on it.
- Clicking the + button will open Job Studio for you to enter details for your new job.
- See details on how to use Job Studio here.
Job Studio
Job Studio is OpenFn's Job Editor. It allows you to create a new job or edit an exisiting one. It can be accessed by following the steps for editing an existing job or creating a new job. The instructions below assume you already know how to open Job Studio by either methods.
Changing Job Studio mode
Job Studio comes in two editing modes, namely Wizard mode and Fullscreen mode. By default, OpenFn JobStudio runs in wizard mode. Wizard mode allows you to configure a job via a step-by-step configuration wizard. On the other hand, Fullscreen mode allows you to quickly configure or edit the job without the help of the wizard.
To change from one Job Studio mode to another, follow the steps below:
- While in Job Studio, in the top-right corner, click on the fullscreen icon.
- Depending on the current Job Studio mode, clicking on the fullscreen icon will toggle the editing mode to either Wizard or Fullscreen.
Note that once you toggle the editing mode, OpenFn updates your user settings and saves this editing preference as your default Job Studio mode for subsequent editing sessions. Note, however, that when creating new jobs, Job Studio will always open in Wizard mode, regardless of your saved editing mode preference.
Configuring a job
While in Job Studio, if in Wizard mode, you will see four configuration steps and an expression editor. In Fullscreen mode, the four configuration steps appear as regular fields, without a wizard.
The four configuration steps include giving the job a name, defining what triggers its execution, selecting an adaptor, and providing authentication details.
The expression editor is the area where you write your job expression. Fill-in all the details, and click on the Save icon in the top-right corner to save your job's configuration changes.
Inspecting job's initial state
This feature allows you to view the initial state of a selected job. Note that this feature is currently only available for message-triggered jobs.
To view or inspect a job's initial state, click the expression pane splitter and
drag to the right. After dragging, you will see a json tree representation of
the matching initial state. To copy a path to a given node in the state, click
on the Copy to clipboard icon overlaid on the node. The path to that node
will be saved to clipboard, and can then be pasted inside the expression editor
as data path for the job's expression.
Accessing inline adaptor documentation
For a selected adaptor, OpenFn allows you to view documentation and code examples for each adaptor operation.
To view adaptor documentation, click on the documentation icon(first icon) on
the top-right corner of the Expression Pane.
Each adaptor operation has a short description and an example. You can click on the example expression to copy and use it in your job's expression editor.
Also note that expression examples or code snippets for adaptor operations can
be auto-generated through the expression editor's autocompletion feature. To
generate a code snippet for a given operation, type the first few letters of the
operation and press the tab key.