Task Data Type

The Task object is passed as a parameter to the TaskInitiator callback functions as taskData. Its shape is specified below:

type Task = {
trigger: {
appKey: string; // `appKey` of the trigger app
triggerKey: string; // `key` of the trigger
credentialId: string; // `id` of the trigger Credential
inputParams: {
// Trigger input parameters
[param: string]: any;
};
};
action: {
appKey: string; // `appKey` of the action app
actionKey: string; // `key` of the action
credentialId: string; // `id` of the trigger Credential
inputParams: {
// Action input parameters
[param: string]: any;
};
};
};

Upon successful execution of a one off Task, the resultData property available on the onSuccess callback will have the following shape:

type TaskResultData = {
actionOutput: any;
triggerOutput: any;
};

For example, when using a third party trigger such as a Dropbox file selection, the triggerOutput will contain the relevant metadata necessary to act upon.

// after successful execution of a task with a dropbox trigger source:
triggerOutput: {
file_name: "vegeta.svg",
direct_media_link: "http://linkto.file",
bytes: 9001
// etc
}