Skip to main content

Call

The Call task allows you to make calls to external services.

Properties

NameTypeRequiredDescription
callstringyesThe name of the function to call. One of activity or http.
withmapnoA name/value mapping of the parameters to call the function with

Activity

Call an external Temporal activity running on a separate Task Queue within the same namespace.

To use this, the call property must equal activity.

Properties

NameTypeRequiredDescription
namestringyesThe activity name to call.
argumentsstringany[]The arguments to pass to the activity. These are interpolated through the state.
taskQueuestringyesThe task queue where the activity is running.

Example

document:
dsl: 1.0.0
namespace: zigflow
name: external-activity-call
version: 0.0.1
do:
- captureInput:
set:
requestedUserId: ${ $input.userId }
requestId: ${ uuid }
- fetchProfile:
call: activity
with:
name: activitycall.FetchProfile
arguments:
- ${ $data.requestedUserId }
- ${ $data.requestId }
taskQueue: activity-call-worker

gRPC

Call an external resource via gRPC. To use this, the call property must equal grpc.

Properties

NameTypeRequiredDescription
proto.endpointstringyesThe proto resource that describes the gRPC service to call..
service.namestringyesThe name of the gRPC service to call.
service.hoststringyesThe hostname of the gRPC service to call.
service.portintegernoThe port number of the gRPC service to call.
methodstringyesThe name of the gRPC service method to call.
argumentsmapnoA name/value mapping of the method call's arguments, if any.

Example

document:
dsl: 1.0.0
namespace: zigflow
name: external-activity-call
version: 0.0.1
do:
- greet:
call: grpc
with:
proto:
endpoint: file:///go/app/examples/external-calls/grpc/basic/proto/basic/v1/basic.proto
service:
name: providers.v1.BasicService
host: grpc
port: 3000
method: Command1
arguments:
input: hello world

HTTP

Call an external resource via HTTP. To use this, the call property must equal http.

Properties

NameTypeRequiredDescription
methodstringyesThe HTTP request method.
endpointstring|endpointyesAn URI or an object that describes the HTTP endpoint to call.
headersmapnoA name/value mapping of the HTTP headers to use, if any.
bodyanynoThe HTTP request body, if any.
querymap[string, any]noA name/value mapping of the query parameters to use, if any.
outputstringnoThe http call's output format.
Supported values are:
- raw, which output's the base-64 encoded http response content, if any.
- content, which outputs the content of http response, possibly deserialized.
- response, which outputs the http response.
Defaults to content.
redirectbooleannoSpecifies whether redirection status codes (300–399) should be treated as errors.
If set to false, runtimes must raise an error for response status codes outside the 200–299 range.
If set to true, they must raise an error for status codes outside the 200–399 range.
Defaults to false.

Example

document:
dsl: 1.0.0
namespace: zigflow
name: call-http
version: 0.0.1
do:
- getUser:
call: http
with:
method: get
endpoint: https://jsonplaceholder.typicode.com/users/2