Importing Inbound Flow(yaml format) through Architect Scripting

Is there any way to import yaml script through Architect Scripting?, I was able to import an i3Inbound format flow, but not in yaml format.

Please refer to the Archy tool for yaml-based Architect configuration: https://developer.genesys.cloud/devapps/archy/

Hi Tim,
so I wanted to import through Architect Scripting instead of Archy
this is what i am trying to do...

function callbackFunctionStart(){
return scriptingFlowFactory.createFlowInboundCallAsync('flow name', 'Using Architect Scripting', scriptingLanguages.englishUnitedStates, (archInboundCall) => {
return archInboundCall.importFromContentAsync(file, () => {
return archInboundCall.publishAsync();
});
});
}

when I gave file in i3Inbound format it is working but if it is in YAML format it is throwing error.

https://mypurecloud.github.io/purecloud-flow-scripting-api-sdk-javascript/ArchBaseFlow.html#importFromContentAsync documents the exportContent parameter as "the contents from a flow export"

https://mypurecloud.github.io/purecloud-flow-scripting-api-sdk-javascript/ArchBaseFlow.html#exportToObjectAsync is documented as "Exports the flow to a JSON object. The object passed back in the callback function will be a JSON object..."

The architect flow scripting SDK is explicitly documented to work with JSON, not YAML.

That makes sense based on the documentation since it requires JSON from a previous export operation.

Hi Tim,

So I have tried converting inbound flow from yaml format to json using "js-yaml" module but still I am getting errors
But when I tried converting same inbound flow which is in i3Inbound format, to json format using below code

let json = decodeURIComponent(atob(i3Inbound))

It gave me a data in json format and when I tried to import this json data it is working

function callbackFunctionStart(){
return scriptingFlowFactory.createFlowInboundCallAsync('flowname', 'Using Architect Scripting', scriptingLanguages.englishUnitedStates, (archInboundCall) => {
return archInboundCall.importFromContentAsync(json , () => {
return archInboundCall.publishAsync();
});
});
}

Is there any reason why 'yaml to json' converted file is throwing errors and any way to import that file...?

Presumably they're not identical. Have you done a diff on the working vs. non-working files to see what's different between them? If they're identical, character for character, they should behave the same.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.