Tasks are individual building blocks of a Run.
io.wait()
), we need to call the Job.run
function multiple times. If we didn’t cache the results of Tasks, then we would be repeating work on each run.
cacheKey
. This is a unique identifier for the Task inside that Run. It is used for storing the cached result of a task. It is also used to identify the Task in the Viewing Runs Dashboard.
io.integration.runTask()
wrapperio.runTask()
io.runTask()
function allows you to run a Task manually. It takes a cacheKey
and a function to run. The function will only be run if the Task is not already cached.
task
object, which can be useful for providing an idempotency key to an external service. For example, Stripe:
runTask
also takes an optional 3rd argument, which allows you to customize how the Task is displayed and run. For example, you can supply a name and some properties to be displayed in the Viewing Runs Dashboard:
io.integration.runTask()
runTask()
function. The main differences between this and io.runTask()
are:
icon
property on the Task.runTask
function to create a project card when a new user signs up:
postMessage()
function:
cacheKey
as the first argument, because they are Tasks under the hood. Think of them as a convenience wrapper around io.runTask()
.
We strive to document all of the task wrapper functions in our Integration packages. For example, checkout our GitHub integration task docs.
runTask
function, so the tasks
inside the function are not accidentally reused.