I’m working with Temporal to run communication workflows. A workflow can send multiple communications, and each communication will have metrics about its result. I’m also using schedules to trigger these workflows.
I want to be able to filter in my database the communications of a workflow execution and their related events. The problem is that I’m not sure which identifiers I should store in the database.
One option could be to have the following entities:
WorkflowDef
, WorkflowSchedule
, WorkflowId
, WorkflowExecution
, Communications
, and Events
.
But this feels too complex.
From what I’ve seen, when a schedule triggers a workflow, a different workflow ID is created for each scheduled run, along with an execution_id
. Keeping track of all these identifiers seems like unnecessary complexity.
Would it make sense to simplify the model to something like:
WorkflowDef
,WorkflowSchedule
, andWorkflowExecutions
(withexecution_id
),Communications
andEvents
?
Or maybe:WorkflowDef
,WorkflowSchedule
,Workflow
(withworkflow_id
),Communications
andEvents
?
Any advice would be really helpful!