Skip to content

[Submission] Temporal OneShot — Reliable One-Time Workflow Scheduling Made Simple #109

@harimanasa

Description

@harimanasa

Project link

https://github.com/harimanasa/Temporal-OneShot

Language

TypeScript

Short description (max 256 chars)

A simple utility to reliably schedule one-time workflows in Temporal. Abstracts away interval/phase quirks, ensures exactly one execution, and provides validation + preview to prevent silent scheduling failures.

Long Description

🚀 Temporal OneShot — Simplifying One-Time Workflow Scheduling

Temporal schedules are powerful, but they are primarily designed for recurring workflows. Scheduling a workflow to run exactly once at a specific time requires non-intuitive constructs like intervals, phase offsets, and tightly scoped execution windows.

This often leads to:

Hidden complexity in schedule specs
Silent failures when intervals are missing
Confusing developer experience
Repeated boilerplate logic across services

💡 What This Project Solves

Temporal OneShot introduces a simple abstraction for fire-once workflows:

await scheduleOnce({
workflowType: "MyWorkflow",
runAt: new Date("2026-05-10T10:00:00.123Z"),
});

Instead of requiring developers to manually construct schedule specs, this utility:

Automatically generates a safe synthetic schedule
Aligns phase offset with millisecond precision
Ensures exactly one execution
Prevents duplicate or missed runs
⚙️ How It Works

Under the hood, Temporal OneShot creates a minimal schedule:

every = 1s → provides a cadence for Temporal’s scheduler
phase = runAt % 1000ms → aligns execution precisely
endAt = runAt + 1ms → restricts execution to a single tick

This guarantees that exactly one execution occurs, while keeping all complexity internal.

🔍 Validation & Preview

The tool also includes a validation layer:

npx temporal-oneshot validate --run-at "2026-05-10T10:00:00.123Z"

Output:

✅ Valid one-shot schedule
Next run: 2026-05-10T10:00:00.123Z
Execution count: exactly 1

This helps catch errors before deployment and improves developer confidence.

🎬 Demo
Input a timestamp (e.g., now + 10 seconds)
Create schedule via CLI or API
Observe:
Schedule creation
Exact execution time
Workflow runs once and completes

🎯 Why This Matters
Improves developer experience for Temporal users
Eliminates hidden scheduling pitfalls
Reduces production bugs caused by misconfigured schedules
Provides a reusable pattern for one-time execution

🔮 Future Enhancements
UI-based schedule playground
Timeline visualization of execution
Support for hybrid schedules (one-time + recurring)
Integration into Temporal SDK or extensions

🏁 Summary

Temporal workflows are powerful —
Temporal OneShot makes one-time scheduling simple, safe, and predictable.

Author(s)

Manasa Hari
Software Engineer, Adobe
GitHub: https://github.com/harimanasa
LinkedIn: https://www.linkedin.com/in/harimanasa/

Metadata

Metadata

Assignees

Labels

code exchange submissionCode and/or content about Temporal!triageIssues that Temporal folk need to look atziggy reviewedPre-screened by ZiggyBot

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions