TemporalEx.Converter.Schedule
(temporal_ex v0.2.1)
Copy Markdown
Helpers for building Temporal Schedule protobuf types from plain Elixir values.
Summary
Functions
Builds a Temporal.Api.Schedule.V1.CalendarSpec from keyword options.
Builds a Temporal.Api.Schedule.V1.IntervalSpec.
Converts a friendly overlap policy atom to the protobuf enum value.
Builds a Temporal.Api.Schedule.V1.Range.
Builds a Temporal.Api.Schedule.V1.Schedule from keyword options.
Builds a Temporal.Api.Schedule.V1.ScheduleAction with a start_workflow action.
Builds a Temporal.Api.Schedule.V1.SchedulePatch from keyword options.
Builds a Temporal.Api.Schedule.V1.SchedulePolicies from keyword options.
Builds a Temporal.Api.Schedule.V1.ScheduleSpec from keyword options.
Builds a Temporal.Api.Schedule.V1.ScheduleState from keyword options.
Builds a Temporal.Api.Schedule.V1.StructuredCalendarSpec from keyword options.
Functions
Builds a Temporal.Api.Schedule.V1.CalendarSpec from keyword options.
Options
All fields are cron-like strings (e.g., "0", "*/5", "1,15"):
:second,:minute,:hour:day_of_month,:month,:year:day_of_week:comment
Builds a Temporal.Api.Schedule.V1.IntervalSpec.
Accepts a keyword list with :every (required, seconds) and :offset (optional, seconds).
Converts a friendly overlap policy atom to the protobuf enum value.
Builds a Temporal.Api.Schedule.V1.Range.
Accepts a keyword list with :start, :end (defaults to :start), and
:step (defaults to 1), or a bare integer as shorthand for an exact match
(5 is equivalent to [start: 5, end: 5, step: 1]).
Builds a Temporal.Api.Schedule.V1.Schedule from keyword options.
Options
:spec— Schedule spec (keyword list, seeto_schedule_spec/1):action— Schedule action (keyword list, seeto_schedule_action/2):policies— Schedule policies (keyword list, seeto_schedule_policies/1):state— Schedule state (keyword list, seeto_schedule_state/1)
Builds a Temporal.Api.Schedule.V1.ScheduleAction with a start_workflow action.
Options
:workflow_type— Workflow type name (required):task_queue— Task queue name (required):workflow_id— Workflow ID (required):args— List of workflow arguments:execution_timeout— Max total time in seconds:run_timeout— Max single run time in seconds:task_timeout— Max task processing time in seconds:retry_policy— Retry policy keyword list:memo— Memo map:search_attributes— Search attributes map
Builds a Temporal.Api.Schedule.V1.SchedulePatch from keyword options.
Options
:pause— String note for pausing:unpause— String note for unpausing:trigger_immediately— Boolean or keyword list with:overlap_policy:backfill— List of backfill request keyword lists
Builds a Temporal.Api.Schedule.V1.SchedulePolicies from keyword options.
Options
:overlap_policy— Overlap policy atom (e.g.,:skip,:buffer_one,:cancel_other,:terminate_other,:allow_all):catchup_window— Catchup window in seconds:pause_on_failure— Boolean:keep_original_workflow_id— Boolean. Whentrue, each scheduled run uses the action's configured workflow ID verbatim instead of appending a timestamp suffix. Required for deployments that rely on fixed workflow IDs for conflict or reuse semantics.
Builds a Temporal.Api.Schedule.V1.ScheduleSpec from keyword options.
Options
:intervals— List of interval specs[every: seconds]or[every: seconds, offset: seconds]:calendars— List of (deprecated string-based) calendar spec keyword lists:structured_calendars— List of structured calendar spec keyword lists (seeto_structured_calendar_spec/1):exclude_calendars— List of (deprecated string-based) calendar specs to exclude (blackout windows):exclude_structured_calendars— List of structured calendar specs to exclude:cron_expressions— List of cron expression strings:start_time—DateTimewhen the schedule becomes active:end_time—DateTimewhen the schedule stops:jitter— Max random jitter in seconds:timezone— Timezone name string (e.g.,"America/Chicago")
Exclusion fields mark blackout windows: the schedule does not fire when the current time matches an excluded calendar.
Builds a Temporal.Api.Schedule.V1.ScheduleState from keyword options.
Options
:paused— Boolean:notes— String:limited_actions— Boolean:remaining_actions— Integer
Builds a Temporal.Api.Schedule.V1.StructuredCalendarSpec from keyword options.
Each field accepts a list of ranges (see to_range/1), for example
minute: [[start: 0, end: 59, step: 5]] or a shorthand hour: [9] meaning
"exactly hour 9". Omitted (or empty-list) fields are filled with cron-style
wildcards so the spec actually matches: time fields default to 0, date
fields to their full range, and :year defaults to "all years".
Options
:second,:minute,:hour:day_of_month,:month,:year:day_of_week(0 = Sunday, 6 = Saturday):comment
Examples
# Every 15 minutes throughout each day, every day:
Schedule.to_structured_calendar_spec(minute: [[start: 0, end: 59, step: 15]])
# 09:30 every weekday:
Schedule.to_structured_calendar_spec(
hour: [9], minute: [30], day_of_week: [[start: 1, end: 5]]
)