Skip to content

Workflows

Where: Workflows
Who can use it: Admins and Owners

Workflows run data jobs for you on a schedule, so you don't load exported files or copy database permissions by hand. A Load CSV workflow loads CSV files into Tursio's internal PostgreSQL. A Sync access workflow reads the permissions you already maintain in your database and applies them to Tursio access control.

The Workflows page

The page lists every workflow with its type, description, creation date, last update (UTC), and current status. Use Search and the All statuses filter to find a workflow. Keep Auto refresh on to see status changes as runs finish.

Workflows page with a running workflow and its row menu open (1) Create workflow, (2) current status, (3) row menu with Run, Edit, and Delete.

A workflow's status is one of:

  • Scheduled: created and waiting for its first scheduled run.
  • Running: a run is in progress.
  • Success: the last run finished.
  • Failed: the last run stopped with an error.
  • Stale: a run was cut off because Tursio restarted while it was running.

Create a workflow

  1. Open Workflows and select Create workflow.
  2. Pick a Type: Load CSV or Sync access. The rest of the form appears once you pick a type.

Create workflow dialog with the Type list open (1) Pick Load CSV or Sync access.

Then follow the steps for that type below.

Load CSV

A Load CSV workflow reads files from a source on a schedule and loads them into Tursio's internal PostgreSQL. Use it for systems that export data as files, such as Symitar (Jack Henry) core data.

Before you start

  • Put the CSV files in a folder on the storage volume mounted to the Tursio container. This is storage on the Tursio server, not your computer.
  • Prepare a data specification: a JSON file that names the target database and describes each table. For example:
{
  "database": "csv_load_test",
  "tables": {
    "customers": {
      "csv_file": "customers.csv",
      "primary_key": ["id"],
      "columns": {
        "id": {"data_type": "integer"},
        "name": {"data_type": "text"},
        "signup_date": {"data_type": "date"},
        "balance": {"data_type": "numeric(12,2)"}
      }
    }
  }
}
Data specification reference

The specification supports these keys:

Key Required What it does
database Yes Name of the PostgreSQL database to load into.
tables Yes One entry per table, keyed by table name.
csv_file Yes CSV file to load into the table, inside the folder path.
columns Yes One entry per column, keyed by column name. Each column needs a data_type.
data_type Yes Column type. Types are never inferred.
csv_header_name No CSV header for the column, if it differs from the column name.
format No Date format for date and timestamp columns stored in a non-ISO format.
null_values No Extra values to read as NULL. An empty field is always NULL.
primary_key No List of primary key columns.
foreign_keys No Links to a parent table, as [{"<parent>": {"<column>": "<parent key column>"}}]. Must cover the parent's whole primary key.
delimiter No Single-character delimiter. Defaults to a comma.
max_bytes No Overrides the loader's default size limit for this file.

Supported data_type values: text, varchar(n), char(n), integer, bigint, smallint, numeric, numeric(p,s), real, double precision, boolean, date, and timestamp.

Database, table, and column names must use lowercase letters, digits, and underscores, can't start with a digit, and can be up to 63 characters. Reserved words such as user, order, and table aren't allowed as names.

Steps

  1. Type a Name and, optionally, a Description. Tursio adds the target database to the description, for example Dataset: csv_load_test.
  2. Keep Source set to Mounted volume. It's the only source today.
  3. Enter the Folder path inside the mounted volume, for example exports/daily. Leave it empty to read from the volume's root.
  4. Upload the Data specification (.json).
  5. Pick a Schedule. Daily runs every day at the time you set. Weekly runs once a week on the day and time you set. Times are in UTC.
  6. Select Create. The workflow shows as Scheduled until its first run.

Load CSV form with Source, Folder path, Data specification, and Schedule (1) Source, (2) Folder path, (3) Data specification, (4) Schedule.

Weekly schedule with Day and Time fields (1) Weekly schedule, (2) Day and Time in UTC.

To search the loaded data, add a PostgreSQL connection to the target database in Databases.

Sync access

A Sync access workflow runs your script on a connection every hour, on the hour (UTC), and syncs who can query which tables. The schedule is fixed, so there's nothing to set. Tursio applies the result to Access Control, so the Tursio portal, the Teams agent, and MCP clients follow the same permissions as your database.

Before you start

  • Add and train the connection in Databases.
  • If you want to sync a Microsoft Entra group, add it in All Users with its group object ID.
  • Write a script that returns the permissions to sync. The script must:
    • be a single read-only SELECT statement (a UNION or a WITH clause is fine);
    • return a uid column with a Tursio user's email or a Microsoft Entra group object ID;
    • return a table_name column with the table as schema.table, for example sales.orders;
    • return at least one row.

Tursio runs the script as-is with the connection's credentials. A minimal script looks like this:

SELECT 'analyst@example.com' AS uid, 'sales.orders' AS table_name

In practice, the script reads your database's permission catalog, so access in Tursio follows the grants you already manage. Column names are matched without regard to case.

Steps

  1. Type a Name and, optionally, a Description.
  2. Select the Connection to sync.
  3. Upload the Script (.sql or .txt).
  4. Select Validate. Tursio runs the script on the connection and shows how many IDs matched a Tursio user, how many didn't, and how many users would gain or lose access to the connection. The button then reads Validate again. Picking another connection or file clears the result.
  5. Select Create. Create stays disabled until validation passes. The workflow doesn't run on create. It runs at the next hour, or when you select Run.

Sync access form with Name, Connection, and Script (1) Name, (2) Connection, (3) Script requirements.

Validation summary showing matched users and access changes (1) Validate the script, (2) summary of matched users and access changes.

If validation fails, the form says why and Save stays disabled until you upload a script that passes.

Validation failed with a missing uid column (1) Validation error, (2) Save stays disabled.

Common validation errors:

Message Fix
The script must be read-only: a single SELECT statement. Remove any statement that writes, such as DELETE or UPDATE.
Missing column uid. The script must return uid and table_name. Name the output columns exactly uid and table_name.
The script returned no rows. Check the script's filters against the database.
table_name must be schema.table (row 4: orders). Include the schema, for example sales.orders instead of orders.
uid and table_name can't be empty (row 2). Remove rows with an empty uid or table_name.
Couldn't connect to … Check the connection and try again. Check the connection in Databases.
What a Sync access run does
  • Users and viewers keep the connection only if the script grants them at least one of its query tables. The others lose the connection.
  • Within the connection, each user can query only the tables the script grants them. The rules apply to the connection and its dev connection right away, with no retraining.
  • Owners and admins aren't affected.
  • Access rules you added by hand in Access Control stay as they are.
  • A run applies everything or nothing. If it fails, the previous access stands and the workflow shows Failed.

After a run, granted users appear on the database's row in Users › Access Control. When you revoke a permission in the database, the user loses access in Tursio after the next run.

Run, edit, or delete a workflow

Open the row menu (⋯) on a workflow to:

  • Run: start a run now instead of waiting for the schedule. The status changes to Running.
  • Edit: change the workflow's settings. The Type can't be changed, and for Sync access the Connection can't be changed. Changes apply from the next run.
  • Delete: stop the workflow.

All three are disabled while the workflow is Running.

Deleting a workflow

Deleting stops future runs only. Data a Load CSV workflow already loaded stays where it is. Access a Sync access workflow already applied stays as is.

Delete workflow confirmation (1) Confirm with Delete, or select Keep it to cancel.

Tips and limits

  • Schedules use UTC. Convert your local time before you set Time.
  • If a Load CSV run fails, check that the Folder path points at the folder that holds the CSV files.
  • You can have up to 2 Load CSV workflows by default. Contact Tursio to raise the limit.
  • A connection can have one Sync access workflow. Dev connections can't have one, and a connection that already has one doesn't appear in the Connection list.
  • Sync access isn't available for Cassandra, DynamoDB, Microsoft Excel, or Salesforce connections.
  • IDs in the script that don't match a Tursio user are counted as unmatched and grant nothing.
  • A Sync access workflow doesn't change permissions in your database. Tursio only reads the script's result and changes its own access control.