<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Dependency-Injection on Agent Zone</title><link>https://agent-zone.ai/tags/dependency-injection/</link><description>Recent content in Dependency-Injection on Agent Zone</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 22 Feb 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://agent-zone.ai/tags/dependency-injection/index.xml" rel="self" type="application/rss+xml"/><item><title>Your First Temporal Workflow in Go: DI, Idempotency, and the Worker Pattern</title><link>https://agent-zone.ai/knowledge/workflow-orchestration/temporal-go-workflow-basics/</link><pubDate>Sun, 22 Feb 2026 00:00:00 +0000</pubDate><guid>https://agent-zone.ai/knowledge/workflow-orchestration/temporal-go-workflow-basics/</guid><description>&lt;h1 id="your-first-temporal-workflow-in-go"&gt;Your First Temporal Workflow in Go&lt;a class="anchor" href="#your-first-temporal-workflow-in-go"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;This article establishes the patterns used throughout the Temporal series: dependency injection for testable activities, idempotency for safe retries, and a clean worker binary. Every subsequent article builds on these foundations.&lt;/p&gt;
&lt;p&gt;All code lives in the companion repo at &lt;a href="https://github.com/statherm/temporal-examples"&gt;github.com/statherm/temporal-examples&lt;/a&gt;. For background, see &lt;a href="../temporal-introduction/"&gt;Introduction to Temporal&lt;/a&gt; and &lt;a href="../temporal-namespaces-task-queues/"&gt;Namespaces and Task Queues&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="project-structure"&gt;Project Structure&lt;a class="anchor" href="#project-structure"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The companion repo organizes code by domain:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;temporal-examples/
 cmd/worker/main.go # Worker binary
 cmd/starter/main.go # Workflow starter CLI
 internal/container/
 activities.go # Activity implementations with DI
 workflow.go # Workflow definitions
 types.go # Interfaces and types
 Makefile&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="workflows-and-activities"&gt;Workflows and Activities&lt;a class="anchor" href="#workflows-and-activities"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A workflow is a deterministic function that orchestrates work. It takes &lt;code&gt;workflow.Context&lt;/code&gt;, must not perform side effects, and dispatches work through activities. Activities use standard &lt;code&gt;context.Context&lt;/code&gt; and perform real I/O:&lt;/p&gt;</description></item></channel></rss>