We have a Interaction that sends out a series of emails leading up to a sports event. For example:
- 10 weeks prior
- 8 weeks prior
- 4 weeks prior
- 2 weeks prior
- 1 week prior
- 1 week after
Normally an interaction would be a continual linear flow like:
This is fine, but the issue is that the Contact could enter the Interaction at any given time. So, if a Contact enters the Interaction 4 weeks prior to the sporting event, then I would not want them to receive all emails (10 weeks, 8 weeks, etc). I want them to 'skip' forward to the '4 weeks' email.
The simple solution would be to create a Custom Split Activity and define the outcomes based on the date that the Contact enters the Activity and the current date, then route them to the appropriate point in the workflow using a Join Activity. Too easy.
But then I was thinking, rather than hard coding the outcomes
array for all different branch arguments in config.json, I'd like users to define the number of branches and the conditions in a Custom Split Activity modal that could look something like this:
This looks pretty, but the issue is that the outcomes
array is hardcoded in config.json. I am wondering if it's feasible to 'dynamically' create the config.json file when the Journey Builder engine requests it. I see that the execute request contains For example, based on the definitionInstanceId
that we retrieve from the execute request payload to the Custom Activity, which currently looks like this:
{ inArguments:
[ { record: '8888884' }, ],
outArguments: [ { status: 'number' } ],
activityObjectID: 'f3da92d8-b0be-470d-9f7a-a53159a419de',
journeyId: '10845428-41b1-424b-a581-a712cad969ae',
activityId: 'f3da92d8-b0be-470d-9f7a-a53159a419de',
definitionInstanceId: 'b70c693b-d08b-4470-9ec7-0bf0b95b96d8',
activityInstanceId: 'faa5bec3-9cf1-4de9-88a1-3b9693597c24',
keyValue: '8888884',
mode: 0
}
The question is, at what point are the outcome branches required to be retrieved from config.json? They are obviously required for the Interaction Canvas and we could potentially display these by dynamically creating the config.json file based on the current SSO session (which may require the Interaction page to be refreshed if the config.json is loaded on page load), but when a Contact is moving through an Interaction, at what point is the config.json file requested? Is it when the Contact reaches the Activity and an execute request is made?
Is what I am trying to achieve actually possible