Skip to content

workflow/record: Add metadata for debug and replication lag resilience #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 18, 2025

Conversation

andrewwormald
Copy link
Collaborator

@andrewwormald andrewwormald commented Mar 17, 2025

The following have been added in a new type called workflow.Meta and will require a small migration process before upgrading to the version that contains these changes. This is only acceptable as workflow is pre-V1. These are some very old ideas that have numerously come back over and over again as invaluable to a production system. I dont like extending workflow but these are some ideas I believe are intrinsic to having a solution that provides the developers the correct tools to debug issues. One fundamental change is that of the addition of versioning.

Workflow is currently exposed to an issue where it will discard an event if the record store is lagging behind the event streamer. Due to the outbox pattern being implemented this meant it was unlikely happening but the reality is that it's a risk to the systems guaranteed once delivery and processing and should be mitigated.

Here are the fields that are found in Meta and their corresponding purposes:

Version: Ensures data consistency by validating that the record's version matches the event version, preventing issues with stale or out-of-order data that can take place when reading from a replica that is lagging behind the origin of the event.

RunStateReason: Human-readable explanation for the current run state, aiding in debugging by providing context behind state transitions (e.g., "Paused", "Canceled").

StatusDescription: A string representation of the Status field, making it easier to interpret status values (e.g., "In Progress", "Completed") without referencing status codes. Camel case string values are normalised to have spaces again for improved readability

TraceOrigin: Captures the origin or source of the workflow trigger, offering traceability for debugging and auditing purposes.

Copy link

@andrewwormald andrewwormald merged commit 6e89ce6 into main Mar 18, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants