<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Temporal &#8211; iAIFeed</title>
	<atom:link href="https://www.iaifeed.com/tag/temporal/feed" rel="self" type="application/rss+xml" />
	<link>https://www.iaifeed.com</link>
	<description>iAIFeed</description>
	<lastBuildDate>Fri, 16 Oct 2026 12:43:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.5</generator>

<image>
	<url>https://www.iaifeed.com/wp-content/uploads/2026/07/cropped-iaifeed1-80x80.png</url>
	<title>Temporal &#8211; iAIFeed</title>
	<link>https://www.iaifeed.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Handle Retries and Sagas in Temporal</title>
		<link>https://www.iaifeed.com/how-to-handle-retries-and-sagas-in-temporal</link>
					<comments>https://www.iaifeed.com/how-to-handle-retries-and-sagas-in-temporal#respond</comments>
		
		<dc:creator><![CDATA[iamltlb]]></dc:creator>
		<pubDate>Fri, 16 Oct 2026 12:43:47 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Temporal]]></category>
		<guid isPermaLink="false">https://www.iaifeed.com/how-to-handle-retries-and-sagas-in-temporal</guid>

					<description><![CDATA[Master Temporal retry policies, saga compensation and workflow versioning. A practical guide to making long-running processes fail safely in production.]]></description>
										<content:encoded><![CDATA[<p>Getting a Temporal workflow to run is the easy part. Keeping it correct when a third-party API dies halfway through a five-step process is where most teams stumble. This covers retry policies, the saga pattern for rollback, and how to change a running workflow without breaking history.</p>
<p>It assumes you already have a worker and activities running.</p>
<h2>How do Temporal retry policies work?</h2>
<p>Every activity has a RetryPolicy. By default Temporal retries with exponential backoff indefinitely, which is rarely what you want for a payment call.</p>
<pre><code>ao := workflow.ActivityOptions{
  StartToCloseTimeout: time.Minute,
  RetryPolicy: &temporal.RetryPolicy{
    InitialInterval:    time.Second,
    BackoffCoefficient: 2.0,
    MaximumAttempts:    5,
  },
}</code></pre>
<p>Set <code>MaximumAttempts</code> and a <code>NonRetryableErrorTypes</code> list for errors that should fail fast (bad input, auth failure). Retrying a validation error just burns attempts.</p>
<h2>How do I implement a saga (compensation) pattern?</h2>
<p>A saga runs compensating activities in reverse when a later step fails. In <a href="https://www.iaifeed.com/ai-tool/temporal">Temporal</a> you do this with a defer-style cleanup, using a disconnected context so the compensation runs even if the workflow is cancelled.</p>
<ol>
<li>Book the flight (activity A).</li>
<li>Reserve the hotel (activity B).</li>
<li>Charge the card (activity C).</li>
<li>If C fails, run CancelHotel then CancelFlight in reverse order.</li>
</ol>
<p>Wrap the compensations in <code>workflow.NewDisconnectedContext</code> so a cancellation still triggers rollback. Without it, a cancelled workflow skips cleanup and leaves the booking dangling.</p>
<h2>How do I change a workflow that is already running?</h2>
<p>Determinism means you cannot just edit workflow code — old histories will fail replay. Use <code>workflow.GetVersion</code> to branch by version.</p>
<pre><code>v := workflow.GetVersion(ctx, "add-email-step", workflow.DefaultVersion, 1)
if v >= 1 { /* new step */ }</code></pre>
<p>Old workflows take the default path, new ones take v1. Temporal records which branch each run used, so replay stays consistent. For bigger rewrites, run a new workflow type and migrate in-flight work rather than forcing a change.</p>
<h2>Temporal retries vs a plain queue retry</h2>
<table>
<tr>
<th>Feature</th>
<th>Temporal</th>
<th>Basic queue</th>
</tr>
<tr>
<td>Per-step retry policy</td>
<td>Yes, configurable</td>
<td>Manual</td>
</tr>
<tr>
<td>State across restarts</td>
<td>Persisted automatically</td>
<td>You build it</td>
</tr>
<tr>
<td>Compensation support</td>
<td>Pattern + context helpers</td>
<td>Ad hoc</td>
</tr>
<tr>
<td>Replay debugging</td>
<td>Event history</td>
<td>Logs only</td>
</tr>
</table>
<p>The gap shows up most in compensation and replay. A queue makes you write the rollback logic and the state store yourself; Temporal gives you both, at the cost of the determinism rules.</p>
<h2>What are the gotchas?</h2>
<p>Three bite teams. Activity payloads have size limits — keep large blobs in S3 and pass a reference. Timers over a few decades are capped, so extremely long waits need a different design. And compensation activities must themselves be idempotent, because they can also be retried. If CancelFlight runs twice, the second call should no-op, not error.</p>
<h2>Quick Summary</h2>
<ul>
<li>Set explicit retry policies; add NonRetryableErrorTypes so bad input fails fast.</li>
<li>Implement sagas with reverse-order compensations in a disconnected context.</li>
<li>Use <code>workflow.GetVersion</code> to evolve running workflows without breaking replay.</li>
<li>Keep activity payloads small and compensations idempotent.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.iaifeed.com/how-to-handle-retries-and-sagas-in-temporal/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Build Your First Temporal Workflow in Go</title>
		<link>https://www.iaifeed.com/how-to-build-your-first-temporal-workflow-in-go</link>
					<comments>https://www.iaifeed.com/how-to-build-your-first-temporal-workflow-in-go#respond</comments>
		
		<dc:creator><![CDATA[iamltlb]]></dc:creator>
		<pubDate>Fri, 16 Oct 2026 12:43:29 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Temporal]]></category>
		<guid isPermaLink="false">https://www.iaifeed.com/how-to-build-your-first-temporal-workflow-in-go</guid>

					<description><![CDATA[Temporal makes long-running workflows durable by default. Here is how to write, run and inspect your first workflow and activity in Go, step by step.]]></description>
										<content:encoded><![CDATA[<p>Temporal is a workflow engine that keeps multi-step processes running reliably for hours, days or months. You write ordinary functions for the workflow and its activities; Temporal persists every step, so a crash resumes where it left off instead of starting over.</p>
<p>The mental model trips people up at first. Here is the shortest path from install to a running workflow you can inspect.</p>
<h2>What is Temporal and when should I use it?</h2>
<p>Temporal is a durable execution platform. It records workflow state in its own store, so retries, timeouts and long waits survive process restarts. The <a href="https://www.iaifeed.com/ai-tool/temporal">Temporal</a> server handles orchestration while your workers execute code. Reach for it when a process spans multiple services, needs retries with backoff, or must wait on human input — the cases where a queue plus cron gets brittle.</p>
<h2>How do I install and start the server?</h2>
<p>The fastest local setup is the Temporal CLI.</p>
<pre><code>brew install temporal
temporal server start-dev</code></pre>
<p>This spins up a dev server with a Web UI at localhost:8233. No database or config needed — <code>start-dev</code> uses an in-memory store, which is fine for learning but loses data on restart.</p>
<h2>How do I write a workflow and an activity?</h2>
<p>Two pieces. The workflow is deterministic orchestration; activities do the real work (calling APIs, touching databases).</p>
<pre><code>func GreetWorkflow(ctx workflow.Context, name string) (string, error) {
    ao := workflow.ActivityOptions{ScheduleToCloseTimeout: time.Minute}
    ctx = workflow.WithActivityOptions(ctx, ao)
    var result string
    err := workflow.ExecuteActivity(ctx, Greet, name).Get(ctx, &result)
    return result, err
}

func Greet(ctx context.Context, name string) (string, error) {
    return "Hello " + name, nil
}</code></pre>
<p>Register both in a worker, then start the workflow with a client call. The rule that matters: never do network I/O inside a workflow function — put it in an activity. Breaking that rule causes non-determinism errors.</p>
<h2>How do I inspect a running workflow?</h2>
<p>Open the Web UI at localhost:8233. You see the workflow, its event history, each activity attempt, and any retries. That event history is the feature that makes Temporal worth learning — you can replay it to debug a failure that happened three days ago.</p>
<h2>Is Temporal free?</h2>
<p>Temporal is open source under the MIT license, and the dev server is free. Temporal Cloud is the paid managed option, priced on actions and storage; the exact rate depends on tier and volume, so check their calculator. Self-hosting production is free of license cost but you own the Cassandra/MySQL backend and upgrades.</p>
<h2>Where does Temporal add friction?</h2>
<p>Determinism constraints are real: no random numbers, no direct time or I/O in workflow code. Teams used to free-form async code hit this immediately. Local dev also differs from production, since you swap the in-memory store for a real database. And for a simple nightly job, Temporal is overkill — a cron entry does less and costs nothing.</p>
<h2>Quick Summary</h2>
<ul>
<li>Temporal is a durable execution engine; workflow state survives crashes and long waits.</li>
<li>Start locally with <code>temporal server start-dev</code>; UI on port 8233.</li>
<li>Keep workflows deterministic and push all I/O into activities.</li>
<li>Open source and free to self-host; Cloud is paid. Overkill for trivial cron jobs.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.iaifeed.com/how-to-build-your-first-temporal-workflow-in-go/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
