Skip to content

Workflows

workflows

  • Schema: public
  • PK: workflow_id (uuid, gen_random_uuid())

Columns

Column Type Nullable Default Notes
workflow_id uuid NO gen_random_uuid() PK
workflow_name varchar NO
is_shared_with_workspace bool YES false
workflow_status varchar NO active, paused, deleted, etc.
workspace_id bigint YES FK to workspaces
created_by bigint NO FK to users
created_time timestamp YES now()
last_modified_by bigint NO FK to users
last_modified_time timestamp YES now()
workflow_resource_id varchar NO Human-readable resource ID
parent_folders jsonb YES Folder hierarchy path

Key indexes

  • workflows_pkey on (workflow_id)
  • unique_workflow_resource_id UNIQUE on (workflow_resource_id, workspace_id) WHERE workflow_status <> 'deleted'
  • unique_workflow_name UNIQUE on (workflow_name, workspace_id) WHERE workflow_status <> 'deleted'

Notes

  • Soft-deleted via workflow_status = 'deleted'; partial unique indexes exclude deleted rows.
  • Workflow logic lives in workflows_versions; this table is the header/metadata record.