Temporal¶
Temporal is for work that should enter an existing Temporal task queue while the weave keeps its inline dependency graph. Wove starts a workflow with the payload; the workflow should run an activity that executes the payload and posts the result back to Wove.
Use When¶
Your production work already belongs in Temporal.
You need Temporal’s workflow/task-queue deployment model.
The Wove task should be executed inside a Temporal activity, not in the submitting process.
Execution Shape¶
Wove calls
client.start_workflow(...)with the payload.The workflow receives the payload.
The workflow runs an activity that calls
await wove.integrations.worker.arun(payload).The activity posts Wove completion events back to the callback URL.
Dependency¶
Install dispatch support and Temporal in the submitting process and in Temporal workers that execute Wove payloads.
pip install "wove[dispatch]" temporalio
Configure Wove¶
import wove
from myapp.temporal_worker import WovePayloadWorkflow
wove.config(
default_environment="temporal",
environments={
"temporal": {
"executor": "temporal",
"executor_config": {
"target_host": "temporal:7233",
"workflow": WovePayloadWorkflow.run,
"task_queue": "wove",
"callback_token": "shared-secret",
"callback_url": "https://wove-runner.internal/wove/events/shared-secret",
},
}
},
)
You can pass an already connected Temporal client as executor_config["client"]. If client is omitted, Wove connects with target_host and connect_options.
Worker Workflow¶
from datetime import timedelta
from temporalio import activity, workflow
from wove.integrations.worker import arun
@activity.defn
async def run_wove_payload(payload):
return await arun(payload)
@workflow.defn
class WovePayloadWorkflow:
@workflow.run
async def run(self, payload):
return await workflow.execute_activity(
run_wove_payload,
payload,
schedule_to_close_timeout=timedelta(minutes=30),
)
Temporal workflows must remain deterministic. Keep Wove payload execution inside an activity.
Options¶
Key |
Effect |
|---|---|
|
Existing |
|
Temporal server address used when Wove creates the client. |
|
Extra keyword arguments passed to |
|
Workflow function/name passed to |
|
Temporal task queue. |
|
Prefix for generated workflow IDs. Defaults to |
|
Extra keyword arguments passed to |