Workflows: placeholders for formatted dates, durations, the transition and the author
- Dominant language
- C#
- Stars
- 6
- Forks
- 7
- Avg merge
- 4h 42m
- Merged PRs (30d)
- 307
Description
Arnel, 14 September 2026: a teacher signs in, clicks Time in and later Time out, and is emailed "you worked 8 hours today". The entry, the transition and the workflow are configuration today. The email is not, because placeholders cannot format a time, compute a duration, or address the person who did the action.
## What exists
`TemplateVariableExtractor` resolves `{{id}}`, `{{contentType}}`, `{{status}}`, `{{createdAt}}` and `{{updatedAt}}` (ISO 8601, UTC) and flat `{{data.Field}}`. Following a reference and looping over related entries is #805.
## Change
- **Formats.** `{{createdAt | date "MMM d, h:mm tt"}}`, `{{data.Amount | money}}`, `{{data.Name | upper}}`, with a small fixed list of formats, no expressions.
- **Time zone.** Dates format in the tenant's time zone (a site setting, #793) unless the format names one.
- **Durations.** `{{duration createdAt transition.at}}` formatted as hours and minutes, and `{{hours createdAt transition.at}}` as a number to one decimal.
- **The transition.** `{{transition.name}}`, `{{transition.at}}`, `{{transition.by.name}}`, `{{transition.by.email}}` for a workflow triggered by a named transition.
- **The author.** `{{createdBy.name}}` and `{{createdBy.email}}`, resolved from the user record at run time, so the Email action's `To` can be the person who created the entry.
- The workflow designer's placeholder list (`GetAvailableVariables`) includes all of these, so barakoBrew can offer them.
- A user's email is only resolved into an action's parameters, never into delivery or a public response.
## Done when
- A workflow on the `ClockOut` transition of a `timeEntry` emails `{{createdBy.email}}` with "You worked {{duration createdAt transition.at}} today, from {{createdAt | date "h:mm tt"}} to {{transition.at | date "h:mm tt"}}." and the test asserts the rendered text in the tenant's time zone.
- Unknown formats or placeholders render as they do today (left as written) and are listed as warnings when the workflow is saved.
## Where it lives
Core: `TemplateVariableExtractor`, which every action (core or module) resolves placeholders through.
Contributor guide
Research direction
Start with TemplateVariableExtractor and trace how core and module actions resolve placeholders. Then inspect GetAvailableVariables and the ClockOut workflow for a timeEntry, using the stated tenant-time-zone email scenario as the acceptance case. Done means the listed formats, durations, transition and author variables work, warnings preserve unknown values, and user emails stay confined to action parameters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100