How it works
- A job declares its datasets under
outputs.datasetsinworkflow.yml, with the columns each one has. - Its steps write each dataset to
$BENTRA_DATASETS/<name>.jsonas a JSON array of row objects. - After the steps succeed, the Publish datasets step uploads the files. Only successful runs publish.
- If the data changed, Bentra stores it as a new version and makes it current. If nothing changed, the current version stays and only its refresh time is updated.
- Forms and workflows that read the dataset always see the current version.
Limits
Values must be strings, numbers, booleans or null. See
outputs for every rule.
Example: a repository dropdown
A job lists your GitHub organization’s repositories every hour. A request form offers them in a searchable dropdown.1
Give the job a GitHub token
Steps don’t get your connector’s credentials, so a job that calls the GitHub API needs its own token. Create a variable collection with a secret
GITHUB_TOKEN and a plain GITHUB_ORG, and attach it to the job.2
Write the job
Create a job named List org repos (slug
list-org-repos) with this workflow.yml:3
Run it once
On the job’s Runs tab, click Trigger Run. When the run succeeds, the job’s Datasets tab shows
repos with v1 and a preview of its rows.The form in the next steps can only use the dataset after the job has run at least once, because that’s when Bentra learns the dataset’s columns.4
Grant the form's workflow read access
Create the request workflow (here, Repository request). Then open the job’s Settings → Data sharing, click Grant access, pick Repository request and click Grant access.If the request workflow is in another workspace, first widen the job’s Scope. See Who can read a dataset.
5
Read the dataset in the form
In the request workflow’s The dropdown shows each repository’s
form.yml, use options_from instead of options:name, submits its full_name, and leaves out archived repositories. Steps receive the choice as $REPOSITORY.6
Keep it current
In the job’s Settings → Job Settings, turn on Scheduled Runs with
0 * * * *. New repositories appear in the dropdown after the next hourly run.Read datasets in a form
options_from works on dropdown, checkboxes and radio fields:
- Bentra checks
options_fromwhen you save the form or publish a version: the job must exist, declare the dataset and the columns, and have granted your workflow read access. - When someone submits the form, Bentra checks the chosen value against the current dataset. A value that is no longer in the dataset is rejected.
- Only the columns the form uses are sent to the browser.
options_from in the form syntax for details and a cascading example.
Read datasets in a workflow
Any workflow, job or request, can read other jobs’ datasets as files. Declare them underinputs.datasets:
$BENTRA_INPUTS/<job>/<dataset>.json. The workflow needs a read grant on each job, and each dataset must have been published; otherwise the run fails before any step runs. The setup log shows which version was loaded. See inputs.
Manage versions
Open the job’s Datasets tab. Each dataset shows its columns, the current version and row count, when it was last refreshed, a preview of the rows, and a History of versions:Roll back
Click Make current on an earlier version. Forms and workflows reading the dataset switch to that version right away. Rolling back doesn’t stop the job. Its next successful run with different data publishes a new version and makes it current again. To keep the old version in place, freeze the dataset as well.Freeze
Click Freeze to keep the current version in place:- The job keeps running and uploading.
- Unchanged data only updates the refresh time.
- Changed data becomes a Held version. Readers keep seeing the current version.
- To publish a held version, click Make current on it.
Guard against empty data
If a run writes zero rows while the current version has rows, the run fails and nothing is published. This stops an outage in the source system from emptying every dropdown. Setallow_empty: true on the dataset if an empty result is legitimate.
A dataset the job no longer declares is shown as Retired.
Who can read a dataset
Two settings, both on the job, decide which workflows can read its datasets. Find them in the job’s Settings → Data sharing.- Scope (Shareable with): which workspaces’ workflows can be granted access. This workspace only (the default), Selected workspaces or All workspaces in the org. Click Save scope after changing it.
- Read grants: the workflows that may read the job’s datasets. Click Grant access and pick a request or job workflow inside the scope.
- Data is never shared outside the organization.
- A job can always read its own datasets.
- Narrowing the scope suspends grants that fall outside it instead of deleting them. They come back if you widen the scope again.