These samples show basic workflow and activity features.
To run, first see README.md for prerequisites. Then, run the following from this directory to run the
hello_activity.py
sample:
poetry run python hello_activity.py
The result will be:
Result: Hello, World!
Replace hello_activity.py
in the command with any other example filename to run it instead.
- hello_activity - Execute an activity from a workflow.
- hello_activity_choice - Execute certain activities inside a workflow based on dynamic input.
- hello_activity_method - Demonstrate an activity that is an instance method on a class and can access class state.
- hello_activity_multiprocess - Execute a synchronous activity on a process pool.
- hello_activity_retry - Demonstrate activity retry by failing until a certain number of attempts.
- hello_activity_threaded - Execute a synchronous activity on a thread pool.
- hello_async_activity_completion - Complete an activity outside of the function that was called.
- hello_cancellation - Manually react to cancellation inside workflows and activities.
- hello_child_workflow - Execute a child workflow from a workflow.
- hello_continue_as_new - Use continue as new to restart a workflow.
- hello_cron - Execute a workflow once a minute.
- hello_exception - Execute an activity that raises an error out of the workflow and out of the program.
- hello_local_activity - Execute a local activity from a workflow.
- hello_mtls - Accept URL, namespace, and certificate info as CLI args and use mTLS for connecting to server.
- hello_parallel_activity - Execute multiple activities at once.
- hello_query - Invoke queries on a workflow.
- hello_search_attributes - Start workflow with search attributes then change while running.
- hello_signal - Send signals to a workflow.
- hello_update - Send a request to and a response from a client to a workflow execution.
Note: To enable the workflow update, set the frontend.enableUpdateWorkflowExecution
dynamic config value to true.
temporal server start-dev --dynamic-config-value frontend.enableUpdateWorkflowExecution=true