Tasks are the main way that developers will interact with your Integration. They are the actions that developers will be able to perform in their jobs.
runTask()
function to your integration, before adding individual Tasks. It will be used by all Tasks, and allows users to use any function in the official SDK as a Task.
API | Official SDK | Trigger.Dev Task |
---|---|---|
GitHub (octokit) | client.rest.issues.create | io.github.issues.create |
Typeform | client.forms.get | io.typeform.forms.get |
OpenAI | client.completions.create | io.openai.completions.create |
runTask
function you added above.
Remember we want to structure our integration to match the original SDK. If an SDK has a client.forms.get
function, we want to add a myintegration.forms.get
task.
This requires adding a bit of structure to the SDK, to add the Forms object, the get function and use runTask
inside them.
io.github.issues.create
. This will allow users to create a GitHub issue in their jobs.
Comments inline are for instructional purposes only, and should not be included in your final code.
onError
functiononError
param. See the reference for runTask for more info.
The GitHub integration uses this to retry rate-limited requests when the rate limit resets: