diff --git a/docs/libraries/workflow/USEFUL_QUERIES.md b/docs/libraries/workflow/USEFUL_QUERIES.md new file mode 100644 index 0000000000..5579b9198f --- /dev/null +++ b/docs/libraries/workflow/USEFUL_QUERIES.md @@ -0,0 +1,36 @@ +# Aggregate entire history + +```sql +SELECT location, 'activity' AS t, activity_name AS name +FROM db_workflow.workflow_activity_events +WHERE + workflow_id = $1 AND NOT forgotten +UNION ALL +SELECT location, 'signal' AS t, signal_name AS name +FROM db_workflow.workflow_signal_events +WHERE + workflow_id = $1 AND NOT forgotten +UNION ALL +SELECT location, 'sub_workflow' AS t, sub_workflow_id::STRING AS name +FROM db_workflow.workflow_sub_workflow_events +WHERE + workflow_id = $1 AND NOT forgotten +UNION ALL +SELECT location, 'signal_send' AS t, signal_name AS name +FROM db_workflow.workflow_signal_send_events +WHERE + workflow_id = $1 AND NOT forgotten +UNION ALL +SELECT location, 'message_send' AS t, message_name AS name +FROM db_workflow.workflow_message_send_events +WHERE + workflow_id = $1 AND NOT forgotten +UNION ALL +SELECT location, 'loop' AS t, NULL AS name +FROM db_workflow.workflow_loop_events +WHERE + workflow_id = $1 AND NOT forgotten +ORDER BY location ASC; +``` + +> Remove `AND NOT forgotten` to show all events, including past loop executions diff --git a/lib/chirp-workflow/core/src/ctx/workflow.rs b/lib/chirp-workflow/core/src/ctx/workflow.rs index 61907036b3..ae638f2036 100644 --- a/lib/chirp-workflow/core/src/ctx/workflow.rs +++ b/lib/chirp-workflow/core/src/ctx/workflow.rs @@ -54,10 +54,6 @@ pub struct WorkflowCtx { conn: rivet_connection::Connection, /// All events that have ever been recorded on this workflow. - /// - /// If replaying, the workflow will check that the `ActivityId` is the same for all activities - /// to make sure the workflow hasn't diverged. - /// /// The reason this type is a hashmap is to allow querying by location. event_history: Arc>>, /// Input data passed to this workflow. diff --git a/svc/pkg/cluster/standalone/datacenter-tls-renew/src/lib.rs b/svc/pkg/cluster/standalone/datacenter-tls-renew/src/lib.rs index 80ea4d9d2f..407759e18c 100644 --- a/svc/pkg/cluster/standalone/datacenter-tls-renew/src/lib.rs +++ b/svc/pkg/cluster/standalone/datacenter-tls-renew/src/lib.rs @@ -23,7 +23,6 @@ pub async fn run_from_env(pools: rivet_pools::Pools) -> GlobalResult<()> { " UPDATE db_cluster.datacenter_tls SET state2 = $3 - FROM db_cluster.datacenter_tls WHERE state2 = $1 AND expire_ts < $2