Notes
- You can run these queries from your **data warehouse’s query editor, **a Cargo data model or the **Sandbox **query editor in the system of records section of your workspace’s settings view
- Adapt your query’s syntax for your database (BigQuery or Snowflake)
- If you’re using your own data warehouse as the system of record, the dataset name is the Dataset name from your System of records configuration. If you’re using Cargo’s Snowflake under the hood, reach out to the Cargo team for these details.
Understanding the activities table
The activities data is stored in thecompute__activities
table with the following key structure:
_id
: Unique identifier for each activity_time
: Timestamp when the activity occurredkind
: Type of activity (workflowNodeExecuted, workflowEntered, workflowLeft, segmentEntered, segmentLeft)model_uuid
: Reference to the data model (if applicable)workflow_uuid
: Reference to the workflowplay_uuid
: Reference to the play (if applicable)tool_uuid
: Reference to the tool (if applicable)segment_uuid
: Reference to the segment (for segment activities)context
: JSON object containing detailed activity information
Example: Track workflow node executions
Here’s a simple query to track all node executions for a specific workflow, including their status and any error messages: BigQuery syntax:Key differences between BigQuery and Snowflake
- JSON field access: BigQuery uses
json_value(context, '$.fieldName')
while Snowflake usescontext:fieldName
- Table naming: Depending on the scope selected for your system of record, you’ll need to adapt the table references as follows:
- BigQuery project-level scope: Use
[PROJECT_ID].[DATASET].compute__activities
to fully qualify the table - BigQuery dataset-level scope: Use
[DATASET].compute__activities
when working within a specific dataset - Snowflake database-level scope: Use
[DATABASE]._compute.activities
to reference tables at the database level - Snowflake schema-level scope: Use
[DATABASE].[SCHEMA]._compute__activities
for schema-specific access
- BigQuery project-level scope: Use