-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Some workflows depend on particular info being available in the context. In other words, they may depend on some previous step having been run already.
For example, CreateTransferFromMainAccountToCustomer requires context.account to be set, but this is only set when the GetAccountData workflow is run.
I propose adding a prerequisites parameter to workflows, like so:
var helpers = require("../lib/helpers.js");
module.exports.description = "Creates a balance sourced transfer to a customer.";
module.exports.nextSteps = [];
module.exports.prerequisites = ['GetAccountData']; // looky here
module.exports.steps = [
{
endpoint : "transfers",
method : "post",
model : "CreateBalanceSourcedTransferFromMainAccountToCustomer",
extractor : function(response, context) {
context.transfer = {};
context.transfer.id = response.headers['location'].split('/')[4];
}
}
];So, we can either have prerequisites be other Workflows, or we can have prerequisites be particular keynames of context which we'd check to make sure they aren't undefined.
Metadata
Metadata
Assignees
Labels
No labels