continuum-temporal
Skill84 starsChanged 6 months agoApache-2.0View on GitHub
Build durable agent workflows with Temporal — sequential/parallel/loop/conditional steps, human-in-the-loop approval gates, custom workflows and activities. Invoke when the user asks "long-running workflow", "approval gate", "human in the loop", "retry on failure", "workflow survives restart", or anything Temporal-related.
- Installs packages
In this repository49 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/commands/monitoring/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/continuum.mdcCursor rule
- AgentDB Advanced FeaturesSkill
- AgentDB Learning PluginsSkill
- AgentDB Memory PatternsSkill
- AgentDB Performance OptimizationSkill
- AgentDB Vector SearchSkill
- browserSkill
- continuum-agentSkill
- continuum-claude-codeSkill
- continuum-codexSkill
- continuum-cursorSkill
- continuum-evaluationSkill
- continuum-handoffsSkill
- continuum-llm-providersSkill
- continuum-memorySkill
- continuum-observabilitySkill
- continuum-quickstartSkill
- continuum-recipesSkill
- continuum-streamingSkill
- continuum-testingSkill
- continuum-tools-mcpSkill
- continuum-workflowsSkill
- github-code-reviewSkill
- github-multi-repoSkill
- github-project-managementSkill
- github-release-managementSkill
- github-workflow-automationSkill
- Hooks AutomationSkill
- Pair ProgrammingSkill
- ReasoningBank with AgentDBSkill
- ReasoningBank IntelligenceSkill
- Skill BuilderSkill
- sparc-methodologySkill
- stream-chainSkill
- swarm-advancedSkill
- Swarm OrchestrationSkill
- V3 CLI ModernizationSkill
- V3 Core ImplementationSkill
- V3 DDD ArchitectureSkill
- V3 Deep IntegrationSkill
- V3 MCP OptimizationSkill
- V3 Memory UnificationSkill
- V3 Performance OptimizationSkill
- V3 Security OverhaulSkill
- V3 Swarm CoordinationSkill
- Verification & Quality AssuranceSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 221
Don't run I/O in workflow code — push it into an activity.
- Very specific: line 222
Don't reuse a workflow id — WorkflowAlreadyStartedError.
- Very specific: line 223
Don't forget to register agents with the registry before submitting a workflow that references them — AgentNotRegisteredError.
- Very specific: line 225
Don't forget await client.connect() before start_workflow(...).
- Very specific: line 226
Don't run the worker as a fire-and-forget — await worker.start() blocks.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Continuum Temporal Skill
Authoritative sources: docs/temporal/getting-started.md,
workflow-patterns.md,
custom-agents.md,
custom-workflows.md,
human-in-loop.md,
docker.md.
Setup
pip install "shyftlabs-continuum[temporal]"
docker compose --profile temporal up -dTEMPORAL_ENABLED=true
TEMPORAL_HOST=localhost:7233
TEMPORAL_NAMESPACE=default
TEMPORAL_TASK_QUEUE=orchestrator-agents
TEMPORAL_ENABLE_HUMAN_IN_LOOP=trueThree actors
- Worker — long-running process; polls task queue, executes activities.
- Workflow — declarative durable plan; lives inside Temporal.
- Caller — your app; submits workflows, signals/queries them.
Imports
from continuum.temporal import (
get_temporal_client, get_worker_manager, get_agent_registry,
WorkflowInput, WorkflowResult,
AgentStep, ApprovalStep, ParallelStep, ConditionalStep, WaitStep,
AgentWorkflow, SequentialAgentWorkflow,
ParallelAgentWorkflow, LoopAgentWorkflow,
ApprovalDecision, ApprovalRequest,
HumanInLoopManager, ApprovalNotificationConfig, NotificationParams,
)Hello-Temporal
async def main():
registry = get_agent_registry()
registry.register(BaseAgent(name="summarizer", instructions="...", model="gpt-4o-mini"))
client = get_temporal_client()
await client.connect()
await get_worker_manager(client, registry).start() # blocks
handle = await client.run_agent_workflow(
WorkflowInput(
steps=[
{"type": "agent", "agent_name": "summarizer"},
{"type": "approval", "description": "Review", "approvers": ["alice"]},
{"type": "agent", "agent_name": "summarizer"},
],
initial_input="...",
),
id="hello-001",
)
result = await handle.result()
print(result.status, result.content)Step types
type | Schema |
"agent" | {agent_name, input?, timeout=300, retries=3, metadata} |
"approval" | {description, approvers=[], timeout=86400} |
"parallel" | {agents: [AgentStep…], merge_strategy: "concatenate"|"first_success"|"structured"} |
"conditional" | {condition_agent, if_true: [...], if_false: [...]} |
"wait" | {duration_seconds: 1..604800} |
parse_step(dict) -> WorkflowStep validates a step dict; raises
ValueError on unknown type.
Convenience workflows
# Sequential
input_data = SequentialWorkflowInput(
agent_names=["a", "b", "c"], initial_input="...",
approval_between_steps=False,
)
await client.start_workflow(SequentialAgentWorkflow.run, input_data)
# Parallel
input_data = ParallelWorkflowInput(
agent_names=["a", "b", "c"], initial_input="...",
merge_strategy="structured",
)
# Loop
input_data = LoopWorkflowInput(
agent_name="reviser", initial_input="...",
max_iterations=10, termination_phrase="COMPLETE",
)Signals & queries on AgentWorkflow
| Signal | |
submit_approval(decision: ApprovalDecision) | Approve / reject / escalate |
cancel_workflow() | Cancel |
inject_input(data: dict) | Inject data mid-flow |
| Query | Returns |
get_status() | {status, current_step_index, total_steps, completed_steps, cancelled} |
get_pending_approvals() | list[dict] |
Human-in-the-loop
async def notify(params: NotificationParams) -> None:
if params.type == "approval_required":
await send_email(...)
get_agent_registry().set_notification_handler(notify)
hlm = HumanInLoopManager(
client,
ApprovalNotificationConfig(
handler=notify,
timeout_seconds=86400,
escalation_timeout=7200,
escalation_handler=on_escalate,
),
)
await hlm.approve("workflow-id", request_id="...", decided_by="alice")
await hlm.reject("workflow-id", request_id="...", decided_by="alice", reason="bad draft")
await hlm.escalate("workflow-id", request_id="...", escalate_to="bob")
pending = await hlm.get_pending_approvals("workflow-id")
status = await hlm.get_workflow_status("workflow-id")Custom workflow + activity
from datetime import timedelta
from temporalio import workflow, activity
from temporalio.common import RetryPolicy
@activity.defn(name="fetch_url_activity")
async def fetch_url_activity(url: str) -> str:
async with httpx.AsyncClient(timeout=30.0) as c:
return (await c.get(url)).text
@workflow.defn(sandboxed=False)
class FetchAndSummarizeWorkflow:
@workflow.run
async def run(self, url: str) -> WorkflowResult:
text = await workflow.execute_activity(
fetch_url_activity, url,
start_to_close_timeout=timedelta(seconds=60),
retry_policy=RetryPolicy(maximum_attempts=3),
)
result = await workflow.execute_activity(
"run_agent_activity",
AgentActivityParams(agent_name="summarizer", input=text),
start_to_close_timeout=timedelta(seconds=120),
)
return WorkflowResult(status="completed", content=result.content)
worker = get_worker_manager(client, registry)
worker.register_workflow(FetchAndSummarizeWorkflow)
worker.register_activity(fetch_url_activity)
await worker.start()Determinism rules (critical!)
In a @workflow.defn body:
- ❌
random.random(),uuid.uuid4(),datetime.now(),time.time() - ❌
requests.get(), file/DB I/O, third-party SDKs - ✅
workflow.uuid4(),workflow.random(),workflow.now() - ✅
workflow.execute_activity(...)for I/O - ✅
workflow.sleep(...),workflow.wait_condition(...) - ✅
with workflow.unsafe.imports_passed_through():for type-only imports
Don't
- Don't run I/O in workflow code — push it into an activity.
- Don't reuse a workflow
id—WorkflowAlreadyStartedError. - Don't forget to register agents with the registry before submitting a
workflow that references them —
AgentNotRegisteredError. - Don't forget
await client.connect()beforestart_workflow(...). - Don't run the worker as a fire-and-forget —
await worker.start()blocks; in production it's its own process.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

