TemporalSdk (temporal_sdk v0.2.11)
View SourceCommon Temporal commands and SDK utility functions module.
Summary
Utility functions
Evicts workflow execution.
Utility functions
@spec evict_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id() ) :: :ok | :temporal_sdk_client.call_result_error()
@spec evict_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id(), opts :: :temporal_sdk.evict_workflow_opts() ) :: :ok | :temporal_sdk_client.call_result_error()
Evicts workflow execution.
@spec format_response( cluster :: :temporal_sdk_cluster.cluster_name(), message_name :: :temporal_sdk_client.msg_name(), response :: {:ok, :temporal_sdk_client.msg()} | {:error, term()} ) :: :temporal_sdk.response()
@spec replay_file( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_mod :: module(), filename :: :file.name_all() ) :: :temporal_sdk.replay_json_ret() | {:error, reason :: :file.posix() | :badarg | :terminated | :system_limit}
@spec replay_file( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_mod :: module(), filename :: :file.name_all(), opts :: :temporal_sdk.replay_workflow_opts() ) :: :temporal_sdk.replay_json_ret() | {:error, reason :: :file.posix() | :badarg | :terminated | :system_limit}
@spec replay_json( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_mod :: module(), json :: :unicode.chardata() ) :: :temporal_sdk.replay_json_ret()
@spec replay_json( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_mod :: module(), json :: :unicode.chardata(), opts :: :temporal_sdk.replay_workflow_opts() ) :: :temporal_sdk.replay_json_ret()
@spec replay_task( cluster :: :temporal_sdk_cluster.cluster_name(), task_queue :: :unicode.chardata(), workflow_type :: atom() | :unicode.chardata(), workflow_mod :: module() ) :: :temporal_sdk.replay_json_ret() | :temporal_sdk.call_response_error()
@spec replay_task( cluster :: :temporal_sdk_cluster.cluster_name(), task_queue :: :unicode.chardata(), workflow_type :: atom() | :unicode.chardata(), workflow_mod :: module(), opts :: :temporal_sdk.replay_task_opts() ) :: :temporal_sdk.replay_json_ret() | {:ok, :temporal_sdk.replay_workflow_ret(), :file.name_all()} | :temporal_sdk.call_response_error()
Workflow commands
@spec await_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id() ) :: {:ok, :temporal_sdk.workflow_result()} | {:error, reason :: map() | :invalid_cluster} | :temporal_sdk.call_response_error()
@spec await_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id(), opts :: :temporal_sdk.await_workflow_opts() ) :: {:ok, :temporal_sdk.workflow_result()} | {:error, reason :: map() | :invalid_cluster} | :temporal_sdk.call_response_error()
@spec cancel_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id() ) :: {:ok, :temporal_sdk_proto_service_workflow_binaries."temporal.api.workflowservice.v1.RequestCancelWorkflowExecutionResponse"()} | :temporal_sdk.response()
@spec cancel_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id(), opts :: :temporal_sdk.cancel_workflow_opts() ) :: {:ok, :temporal_sdk_proto_service_workflow_binaries."temporal.api.workflowservice.v1.RequestCancelWorkflowExecutionResponse"()} | :temporal_sdk.response()
@spec delete_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id() ) :: {:ok, :temporal_sdk_proto_service_workflow_binaries."temporal.api.workflowservice.v1.DeleteWorkflowExecutionResponse"()} | :temporal_sdk.response()
@spec delete_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id(), opts :: :temporal_sdk.delete_workflow_opts() ) :: {:ok, :temporal_sdk_proto_service_workflow_binaries."temporal.api.workflowservice.v1.DeleteWorkflowExecutionResponse"()} | :temporal_sdk.response()
Deletes workflow execution.
SDK Samples Workflow Delete demonstrates command use.
@spec describe_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id() ) :: {:ok, :temporal_sdk_proto_service_workflow_binaries."temporal.api.workflowservice.v1.DescribeWorkflowExecutionResponse"()} | :temporal_sdk.response()
@spec describe_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id(), opts :: :temporal_sdk.describe_workflow_opts() ) :: {:ok, :temporal_sdk_proto_service_workflow_binaries."temporal.api.workflowservice.v1.DescribeWorkflowExecutionResponse"()} | :temporal_sdk.response()
@spec get_workflow_history( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id() ) :: {:ok, [ :temporal_sdk_proto_service_workflow_binaries."temporal.api.history.v1.HistoryEvent"(), ... ]} | :temporal_sdk.call_response_error() | {:error, reason :: term()}
@spec get_workflow_history( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id(), opts :: :temporal_sdk.get_workflow_history_opts() ) :: {:ok, :temporal_sdk_proto_service_workflow_binaries."temporal.api.workflowservice.v1.GetWorkflowExecutionHistoryResponse"()} | {:ok, [ :temporal_sdk_proto_service_workflow_binaries."temporal.api.history.v1.HistoryEvent"(), ... ]} | {:ok, [ :temporal_sdk_proto_service_workflow_binaries."temporal.api.history.v1.HistoryEvent"(), ... ], json :: iodata(), :file.name_all()} | {:ok, [ :temporal_sdk_proto_service_workflow_binaries."temporal.api.history.v1.HistoryEvent"(), ... ], json :: iodata()} | :temporal_sdk.call_response_error() | {:error, reason :: :file.posix() | :badarg | :terminated | :system_limit | :timeout | map() | term()}
@spec get_workflow_state( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id() ) :: :temporal_sdk.get_workflow_state_ret()
@spec get_workflow_state( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id(), opts :: :temporal_sdk.describe_workflow_opts() ) :: :temporal_sdk.get_workflow_state_ret()
@spec query_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id(), query_type :: :unicode.chardata() ) :: {:ok, :temporal_sdk_proto_service_workflow_binaries."temporal.api.workflowservice.v1.QueryWorkflowResponse"()} | :temporal_sdk.response()
@spec query_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id(), query_type :: :unicode.chardata(), opts :: :temporal_sdk.query_workflow_opts() ) :: {:ok, :temporal_sdk_proto_service_workflow_binaries."temporal.api.workflowservice.v1.QueryWorkflowResponse"()} | :temporal_sdk.response()
@spec reset_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id() ) :: {:ok, :temporal_sdk_proto_service_workflow_binaries."temporal.api.workflowservice.v1.ResetWorkflowExecutionResponse"()} | :temporal_sdk.response()
@spec reset_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id(), opts :: :temporal_sdk.reset_workflow_opts() ) :: {:ok, :temporal_sdk_proto_service_workflow_binaries."temporal.api.workflowservice.v1.ResetWorkflowExecutionResponse"()} | :temporal_sdk.response()
@spec signal_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id(), signal_name :: :unicode.chardata() ) :: {:ok, :temporal_sdk_proto_service_workflow_binaries."temporal.api.workflowservice.v1.SignalWorkflowExecutionResponse"()} | :temporal_sdk.response()
@spec signal_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id(), signal_name :: :unicode.chardata(), opts :: :temporal_sdk.signal_workflow_opts() ) :: {:ok, :temporal_sdk_proto_service_workflow_binaries."temporal.api.workflowservice.v1.SignalWorkflowExecutionResponse"()} | :temporal_sdk.response()
@spec start_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), task_queue :: :unicode.chardata(), workflow_type :: atom() | :unicode.chardata() ) :: {:ok, :temporal_sdk.start_workflow_ret()} | {:error, reason :: map() | :invalid_cluster} | :temporal_sdk.call_response_error()
@spec start_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), task_queue :: :unicode.chardata(), workflow_type :: atom() | :unicode.chardata(), opts :: :temporal_sdk.start_workflow_opts() ) :: {:ok, :temporal_sdk.start_workflow_ret(), :temporal_sdk.workflow_result()} | {:temporal_sdk.start_workflow_ret(), :temporal_sdk.workflow_result()} | no_return() | {:ok, :temporal_sdk.start_workflow_ret()} | {:error, reason :: map() | :invalid_cluster} | :temporal_sdk.call_response_error()
@spec terminate_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id() ) :: {:ok, :temporal_sdk_proto_service_workflow_binaries."temporal.api.workflowservice.v1.TerminateWorkflowExecutionResponse"()} | :temporal_sdk.response()
@spec terminate_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id(), opts :: :temporal_sdk.terminate_workflow_opts() ) :: {:ok, :temporal_sdk_proto_service_workflow_binaries."temporal.api.workflowservice.v1.TerminateWorkflowExecutionResponse"()} | :temporal_sdk.response()
Terminates workflow execution.
In most cases, it is recommended to use the cancel_workflow/3 command instead.
SDK Samples Workflow Terminate demonstrates command use.
@spec wait_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id() ) :: :temporal_sdk.workflow_result() | no_return()
@spec wait_workflow( cluster :: :temporal_sdk_cluster.cluster_name(), workflow_execution_or_id :: :temporal_sdk.workflow_execution_or_id(), opts :: :temporal_sdk.await_workflow_opts() ) :: :temporal_sdk.workflow_result() | no_return()