Tray Embedded / Version control / Importing / Exporting Solutions

Importing / Exporting Solutions

Tray Embedded has a system whereby you can export and import projects as json files.

This allows you to fully test your Embedded solutions in a 'development' environment (i.e. using test/sandbox accounts and test data) before exporting to a json file, ready to be imported to your 'production' environment.

Some key points are:

  • Authentications are synchronized. The feature works on the basis that you use test authentications/accounts in development and production authentications in production - when importing you only need to create a new authentication the first time and all subsequent imports will automatically map the authentications

  • Workflow settings (properties panel operations, parameters and workflow config) are also synchronized and the settings from the original workflow(s) will always override the settings in the destination workflow properties panel

  • After a first import has been made, you can work on new versions by editing and testing in development, before exporting and importing to production - as many times as you need

  • Note that if the imported version of your solution requires an upgrade (i.e. new auth or config input is required from the End User) then you will need to follow the procedures outlined in Upgrading Solution Instances

  • It is best practice to work with two separate Embedded accounts - i.e. a 'development' account and a 'production' account (note that you can use the Mutliple Accounts feature to easily switch between two accounts)

Starting a project with version control

For testing and publishing the first version of your solution, the basic process is as follows:

  1. Create and test the workflow(s), project and solution you are wishing to publish, using test/sandbox accounts and test data.

  2. Once you are ready to publish the first version of the solution to production, click on the settings wheel next to the name of your Project and export the json file of the project to your local machine.

  1. Now create a new 'production' project in your production account. You do not need to add any workflows at this stage:

Once created, you can enter the project from your dashboard, and you will have the option to Import from project and pick up the json file:

  1. When you first import the project you will be prompted to create your 'prod' authentications for the services included in the project's workflows
  1. Once imported the new version of your solution will be available for use in your external application

Importing subsequent versions

In subsequent versions the following will happen when importing:

  1. Any workflow step settings will be overwritten by the settings in the new version:

Note that there may be discrepancies between the service accounts you are accessing - e.g. your Google Sheets live account may not have the same sheet as your Google Sheets test account. In this case you will have to manually set the sheet in the destination workflow.

  1. Any new services introduced to your workflows will need to be authenticated. For example, if the first version of your solution only contained Slack as a third party service, but you introduced Gmail as another service in the next version, then when importing the next version to production you will need to create a new Gmail authentication (the Slack auth will be automatically linked from the first time you imported it so will not need to be created again)

Version control for pre-existing Solutions

In order to activate version control for pre-existing solutions, you can use the following procedure:

  1. Export your production project
  2. Import this to a new development project, creating test/dev authentications as necessary
  3. Make any changes to your solution in the dev account and once you are ready to publish, export this project
  4. Import the project back into your production project and the authentications should automatically be matched. All your changes should lazy update to end users unless you have added new 'breaking' changes
  5. Now you can start the cycle of editing and testing in development before exporting to production. All development work and changes to the solution should start in the development project from now on

Any time you export from the development project, your authentications will be synced.

Importing and Exporting via API

It is possible to programatically Import and Export workflows and projects / solutions with our GraphQL APIs.

If you are exporting from e.g. a dev account and importing to a production account you will need to have a master token as bearer for each account
The first import of a project will have to be done manually (as described above) in order to allow you to create the linked authentications in the target workflow(s).
If new services are added to any subsequent versions then you will need to run another manual import, as new authentications will need to be created

Exporting Projects

The exportProject mutation can be used to export a Project. This requires the projectId of the Project you wish to export (obtained from the url when editing a Project: https://app.tray.io/project/{projectId}/workflow/{workflowId}/edit )

Note that you will invariably wish to set exportSolution to true.

If this is set to false then it will have one of two effects:

  • If the target Project has a Solution, but as yet no Solution Instances configured by End Users, then the Import process will attempt to delete the Solution in your target Project
  • If the target Project has a Solution, and there are Solution Instances configured by End Users, then it will throw an error
mutation exportProject {
exportProject (input: {
projectId: "d9b4xxx-xxxx-xxx-xxxxxc9f25e"
exportSolution: true
}) {
exportedProjectJson
}
}

The response to this will contain the exportedProjectJson (this is the same json output as per a manual export but in stringified format).

{
"data": {
"exportProject": {
"exportedProjectJson": "{\n \"export_type\" : \"project\",\n \"projects\" : [ {\n \"id\" : \"d9b41594-xxxx-xxxx-xxxx-ffff9bc9f25e\",\n \"name\" : \"Webhook demo\",\n \"config\" : {\n \"slack-channel\" : \"CE3KXDFTP\",\n \"slack-message\" : \"The webhook for your solution instance has been triggered\"\n },\n \"workflows\" : [ \"804c5f50-9xxx-xxx-xxx507ff45\", \"ddcxxx-xxx-xxx-xxx-xxx7296cfc2\" ],\n \"dependencies\" : [ ]\n } ],\n \"solution\" : {\n \"id\" : \"91c0fxxx-xxx-xxx-xxx-xx978ea5\",\n \"name\" : \"Webhook demo\",\n \"description\" : \"\",\n \"project_id\" : \"d9b41594-xxxx-xxxx-xxxx-ffff9bc9f25e\",\n \"tags\" : [ ],\n \"custom_fields\" : { },\n \"view_schema\" : {\n \"version\" : 5,\n \"screens\" : [ {\n \"id\" : \"af463xxx-xxx-xxx-xxx-xxx85d65d\",\n \"hidden\" : true,\n \"items\" : [ {\n \"id\" : \"e1655xxx-xxx-xxx-xxxx46b6c0\",\n \"itemType\" : 2,\n \"new\" : true,\n \"title\" : \"instance-trigger Public Url\",\n \"workflowId\" : \"ddcxxx-xxx-xxx-xxx-xxx96cfc2\"\n } ],\n \"new\" : false\n }, {\n \"id\" : \"b717xxx-xxx-xxx-xxx-xxx222f8\",\n \"new\" : false,\n \"items\" : [ {\n \"id\" : \"83aaexxx-xxx-xxx-xxx-xxxf74b888\",\n xxx-xxx-xxx-xxx9a3-xxxx-xxxx-xxxx-ddcfc327555e\",\n \"itemType\" : 4,\n \"content\" : \"Below is the webhook url for your workflow instance\"\n }, {\n \"id\" : \"d330cxxx-xxx-xxx-xxxef81e36\",\n \"itemType\" : 2,\n \"new\" : false,\n \"title\" : \"Webhook demo Public Url\",\n \"workflowId\" : \"804cxxx-xxx-xxx-xxxx07ff45\"\n } ]\n }, {\n \"id\" : \"56a6xxx-xxx-xxx-xxx-xxxc347ba3\",\n \"items\" : [ {\n \"id\" : \"d147bxxx-xxx-xxx-xxx-xxxb9d15\",\n \"itemType\" : 3,\n \"content\" : \"Slack authentication\"\n }, {\n \"id\" : \"c515xxx-xxx-xxx-xxx76a3b30\",\n \"itemType\" : 4,\n \"content\" : \"Please create your Slack authentication and set the alerting channel and message\"\n }, {\n \"id\" : \"e20b5e3c-xxxx-xxxx-xxxx-9fe607ac7daa\",\n \"itemType\" : 0,\n \"new\" : false,\n \"buttonCTA\" : \"New authentication\",\n \"slot\" : {\n \"id\" : \"4eb7b636-xxxx-xxxx-xxxx-8f0227713362\",\n \"authId\" : \"03d1c064-xxxx-xxxx-xxxx-5d0ae56813f5\",\n \"serviceId\" : \"aba1a078-xxxx-xxxx-xxxx-0b703b29e76d\",\n \"authAppId\" : \"70fce61a-xxxx-xxxx-xxxx-c3b26fe1a4c5\",\n \"title\" : \"Slack authentication\",\n \"description\" : \"\",\n \"externalId\" : \"external_slack_authentication\",\n \"hidden\" : false,\n \"useExisting\" : false,\n \"static\" : false,\n \"scopes\" : [ \"users:read\", \"groups:write\", \"users:read.email\", \"channels:read\", \"chat:write:user\", \"files:read\", \"reminders:write\", \"channels:write\", \"groups:read\", \"chat:write:bot\" ],\n \"usage\" : [ {\n \"workflowId\" : \"804c5f50-xxxx-xxxx-xxxx-9338c507ff45\",\n \"versionId\" : \"2e926fa4-xxxx-xxxx-xxxx-5329575c93e1\",\n \"steps\" : [ {\n \"stepName\" : \"slack-1\",\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"6.0\"\n },\n \"operation\" : \"send_message\",\n \"authId\" : \"03d1c064-xxxx-xxxx-xxxx-5d0ae56813f5\",\n \"properties\" : [ ]\n } ]\n }, {\n \"workflowId\" : \"ddc64647-xxxx-xxxx-xxxx-5abc7296cfc2\",\n \"versionId\" : \"16dc62e2-xxxx-xxxx-xxxx-0f6686532a1f\",\n \"steps\" : [ {\n \"stepName\" : \"slack-1\",\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"7.0\"\n },\n \"operation\" : \"send_message\",\n \"authId\" : \"03d1c064-xxxx-xxxx-xxxx-5d0ae56813f5\",\n \"properties\" : [ ]\n } ]\n } ]\n }\n }, {\n \"id\" : \"b35abbc0-xxxx-xxxx-xxxx-1a422a821ecc\",\n \"itemType\" : 1,\n \"new\" : false,\n \"slot\" : {\n \"id\" : \"2cc876d6-xxxx-xxxx-xxxx-dc9098bbdb12\",\n \"key\" : \"slack-channel\",\n \"title\" : \"slack-channel\",\n \"description\" : \"\",\n \"externalId\" : \"external_slack-channel\",\n \"hidden\" : false,\n \"type\" : \"string\",\n \"defaultValue\" : \"CE3KXDFTP\",\n \"required\" : true,\n \"useDefaultValue\" : false,\n \"static\" : false,\n \"authSlotId\" : \"4eb7b636-xxxx-xxxx-xxxx-8f0227713362\",\n \"ephemeralMetadata\" : {\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"6.0\"\n },\n \"operation\" : \"send_message\",\n \"ddlOperation\" : \"list_users_channels_groups_ddl\",\n \"propertyPath\" : \"channel\",\n \"dependencies\" : [ ],\n \"ephemeralMetadataType\" : \"Regular\"\n },\n \"usage\" : [ {\n \"workflowId\" : \"804c5f50-xxxx-xxxx-xxxx-9338c507ff45\",\n \"versionId\" : \"2e926fa4-xxxx-xxxx-xxxx-5329575c93e1\",\n \"steps\" : [ {\n \"stepName\" : \"slack-1\",\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"6.0\"\n },\n \"operation\" : \"send_message\",\n \"authId\" : \"03d1c064-xxxx-xxxx-xxxx-5d0ae56813f5\",\n \"properties\" : [ {\n \"path\" : \"channel\",\n \"value\" : {\n \"type\" : \"jsonpath\",\n \"value\" : \"$.config.slack-channel\"\n }\n } ]\n } ]\n } ]\n }\n }, {\n \"id\" : \"c5e7205b-xxxx-xxxx-xxxx-03aedeae0162\",\n \"itemType\" : 1,\n \"new\" : false,\n \"slot\" : {\n \"id\" : \"4022a298-xxxx-xxxx-xxxx-50e5f9fc519a\",\n \"key\" : \"slack-message\",\n \"title\" : \"slack-message\",\n \"description\" : \"\",\n \"externalId\" : \"external_slack-message\",\n \"hidden\" : false,\n \"type\" : \"string\",\n \"defaultValue\" : \"The webhook for your solution instance has been triggered\",\n \"required\" : true,\n \"useDefaultValue\" : false,\n \"static\" : false,\n \"authSlotId\" : \"4eb7b636-xxxx-xxxx-xxxx-8f0227713362\",\n \"usage\" : [ {\n \"workflowId\" : \"804c5f50-xxxx-xxxx-xxxx-9338c507ff45\",\n \"versionId\" : \"2e926fa4-xxxx-xxxx-xxxx-5329575c93e1\",\n \"steps\" : [ {\n \"stepName\" : \"slack-1\",\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"6.0\"\n },\n \"operation\" : \"send_message\",\n \"authId\" : \"03d1c064-xxxx-xxxx-xxxx-5d0ae56813f5\",\n \"properties\" : [ {\n \"path\" : \"text\",\n \"value\" : {\n \"type\" : \"jsonpath\",\n \"value\" : \"$.config.slack-message\"\n }\n } ]\n } ]\n } ]\n }\n } ],\n \"new\" : false\n } ]\n },\n \"auth_slots\" : [ {\n \"id\" : \"4eb7b636-xxxx-xxxx-xxxx-8f0227713362\",\n \"auth_group\" : \"3e268690-xxxx-xxxx-xxxx-41a14d9248b4\",\n \"service_id\" : \"aba1a078-xxxx-xxxx-xxxx-0b703b29e76d\",\n \"auth_app_id\" : \"70fce61a-xxxx-xxxx-xxxx-c3b26fe1a4c5\",\n \"title\" : \"Slack authentication\",\n \"description\" : \"\",\n \"external_id\" : \"external_slack_authentication\",\n \"hidden\" : false,\n \"use_existing\" : false,\n \"static\" : false,\n \"scopes\" : [ \"users:read\", \"groups:write\", \"users:read.email\", \"channels:read\", \"chat:write:user\", \"files:read\", \"reminders:write\", \"channels:write\", \"groups:read\", \"chat:write:bot\" ],\n \"usage\" : [ {\n \"workflow_id\" : \"804c5f50-xxxx-xxxx-xxxx-9338c507ff45\",\n \"version_id\" : \"2e926fa4-xxxx-xxxx-xxxx-5329575c93e1\",\n \"steps\" : [ {\n \"step_name\" : \"slack-1\",\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"6.0\"\n },\n \"operation\" : \"send_message\",\n \"auth_group\" : \"3e268690-xxxx-xxxx-xxxx-41a14d9248b4\",\n \"properties\" : [ ]\n } ]\n }, {\n \"workflow_id\" : \"ddc64647-xxxx-xxxx-xxxx-5abc7296cfc2\",\n \"version_id\" : \"16dc62e2-xxxx-xxxx-xxxx-0f6686532a1f\",\n \"steps\" : [ {\n \"step_name\" : \"slack-1\",\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"7.0\"\n },\n \"operation\" : \"send_message\",\n \"auth_group\" : \"3e268690-xxxx-xxxx-xxxx-41a14d9248b4\",\n \"properties\" : [ ]\n } ]\n } ]\n } ],\n \"config_slots\" : [ {\n \"id\" : \"2cc876d6-xxxx-xxxx-xxxx-dc9098bbdb12\",\n \"key\" : \"slack-channel\",\n \"title\" : \"slack-channel\",\n \"description\" : \"\",\n \"external_id\" : \"external_slack-channel\",\n \"hidden\" : false,\n \"type\" : \"string\",\n \"default_value\" : \"CE3KXDFTP\",\n \"required\" : true,\n \"use_default_value\" : false,\n \"static\" : false,\n \"auth_slot_id\" : \"4eb7b636-xxxx-xxxx-xxxx-8f0227713362\",\n \"ephemeral_metadata\" : {\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"6.0\"\n },\n \"operation\" : \"send_message\",\n \"ddl_operation\" : \"list_users_channels_groups_ddl\",\n \"property_path\" : \"channel\",\n \"dependencies\" : [ ],\n \"ephemeral_metadata_type\" : \"Regular\"\n },\n \"usage\" : [ {\n \"workflow_id\" : \"804c5f50-xxxx-xxxx-xxxx-9338c507ff45\",\n \"version_id\" : \"2e926fa4-xxxx-xxxx-xxxx-5329575c93e1\",\n \"steps\" : [ {\n \"step_name\" : \"slack-1\",\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"6.0\"\n },\n \"operation\" : \"send_message\",\n \"auth_group\" : \"3e268690-xxxx-xxxx-xxxx-41a14d9248b4\",\n \"properties\" : [ {\n \"path\" : \"channel\",\n \"value\" : {\n \"type\" : \"jsonpath\",\n \"value\" : \"$.config.slack-channel\"\n }\n } ]\n } ]\n } ]\n }, {\n \"id\" : \"4022a298-xxxx-xxxx-xxxx-50e5f9fc519a\",\n \"key\" : \"slack-message\",\n \"title\" : \"slack-message\",\n \"description\" : \"\",\n \"external_id\" : \"external_slack-message\",\n \"hidden\" : false,\n \"type\" : \"string\",\n \"default_value\" : \"The webhook for your solution instance has been triggered\",\n \"required\" : true,\n \"use_default_value\" : false,\n \"static\" : false,\n \"auth_slot_id\" : \"4eb7b636-xxxx-xxxx-xxxx-8f0227713362\",\n \"usage\" : [ {\n \"workflow_id\" : \"804c5f50-xxxx-xxxx-xxxx-9338c507ff45\",\n \"version_id\" : \"2e926fa4-xxxx-xxxx-xxxx-5329575c93e1\",\n \"steps\" : [ {\n \"step_name\" : \"slack-1\",\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"6.0\"\n },\n \"operation\" : \"send_message\",\n \"auth_group\" : \"3e268690-xxxx-xxxx-xxxx-41a14d9248b4\",\n \"properties\" : [ {\n \"path\" : \"text\",\n \"value\" : {\n \"type\" : \"jsonpath\",\n \"value\" : \"$.config.slack-message\"\n }\n } ]\n } ]\n } ]\n } ]\n },\n \"tray_export_version\" : 3,\n \"workflows\" : [ {\n \"id\" : \"804c5f50-xxxx-xxxx-xxxx-9338c507ff45\",\n \"created\" : \"2020-09-29T18:52:03.437Z\",\n \"workspace_id\" : \"6c595d5b-xxxx-xxxx-xxxx-959ceb938eae\",\n \"project_id\" : \"d9b41594-xxxx-xxxx-xxxx-ffff9bc9f25e\",\n \"group\" : \"6e7e1eac-xxxx-xxxx-xxxx-9b10518391a8\",\n \"creator\" : \"6c595d5b-xxxx-xxxx-xxxx-959ceb938eae\",\n \"version\" : {\n \"id\" : \"2e926fa4-xxxx-xxxx-xxxx-5329575c93e1\",\n \"created\" : \"2020-09-30T10:01:20.315Z\"\n },\n \"title\" : \"Webhook demo\",\n \"enabled\" : true,\n \"tags\" : [ ],\n \"settings\" : {\n \"config\" : {\n \"slack-channel\" : \"CE3KXDFTP\",\n \"slack-message\" : \"The webhook for your solution instance has been triggered\"\n },\n \"input_schema\" : { },\n \"output_schema\" : { }\n },\n \"steps_structure\" : [ {\n \"name\" : \"trigger\",\n \"type\" : \"normal\",\n \"content\" : { }\n }, {\n \"name\" : \"slack-1\",\n \"type\" : \"normal\",\n \"content\" : { }\n } ],\n \"steps\" : {\n \"slack-1\" : {\n \"title\" : \"Alert slack channel\",\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"6.0\"\n },\n \"operation\" : \"send_message\",\n \"output_schema\" : { },\n \"error_handling\" : { },\n \"authentication\" : {\n \"group\" : \"3e268690-xxxx-xxxx-xxxx-41a14d9248b4\",\n \"title\" : \"Mike Hewitt's Slack account\",\n \"service_icon\" : {\n \"icon_type\" : \"url\",\n \"value\" : \"//s3.amazonaws.com/images.tray.io/artisan/icons/c25033a972715dbbdb7e73ac79261230.png\"\n },\n \"service_id\" : \"aba1a078-xxxx-xxxx-xxxx-0b703b29e76d\",\n \"auth_app_id\" : \"70fce61a-xxxx-xxxx-xxxx-c3b26fe1a4c5\",\n \"scopes\" : [ \"chat:write:bot\", \"chat:write:user\" ]\n },\n \"properties\" : {\n \"link_names\" : {\n \"type\" : \"boolean\",\n \"value\" : false\n },\n \"reply_broadcast\" : {\n \"type\" : \"boolean\",\n \"value\" : false\n },\n \"parse\" : {\n \"type\" : \"string\",\n \"value\" : \"none\"\n },\n \"username\" : {\n \"type\" : \"string\",\n \"value\" : \"Tray.io\"\n },\n \"as_user\" : {\n \"type\" : \"boolean\",\n \"value\" : false\n },\n \"token\" : {\n \"type\" : \"jsonpath\",\n \"value\" : \"$.auth.access_token\"\n },\n \"channel\" : {\n \"type\" : \"jsonpath\",\n \"value\" : \"$.config.slack-channel\"\n },\n \"text\" : {\n \"type\" : \"jsonpath\",\n \"value\" : \"$.config.slack-message\"\n }\n }\n },\n \"trigger\" : {\n \"title\" : \"Webhook\",\n \"connector\" : {\n \"name\" : \"webhook\",\n \"version\" : \"2.2\"\n },\n \"operation\" : \"fire_and_forget\",\n \"output_schema\" : { },\n \"error_handling\" : { },\n \"properties\" : { }\n }\n },\n \"dependencies\" : [ ]\n }, {\n \"id\" : \"ddc64647-xxxx-xxxx-xxxx-5abc7296cfc2\",\n \"created\" : \"2020-11-11T14:34:00.298Z\",\n \"workspace_id\" : \"6c595d5b-xxxx-xxxx-xxxx-959ceb938eae\",\n \"project_id\" : \"d9b41594-xxxx-xxxx-xxxx-ffff9bc9f25e\",\n \"group\" : \"69f86944-xxxx-xxxx-xxxx-0a93d6b178b0\",\n \"creator\" : \"6c595d5b-xxxx-xxxx-xxxx-959ceb938eae\",\n \"version\" : {\n \"id\" : \"16dc62e2-xxxx-xxxx-xxxx-0f6686532a1f\",\n \"created\" : \"2020-11-11T14:37:10.303Z\"\n },\n \"title\" : \"instance-trigger\",\n \"enabled\" : true,\n \"tags\" : [ ],\n \"settings\" : {\n \"config\" : {\n \"slack-channel\" : \"CE3KXDFTP\",\n \"slack-message\" : \"The webhook for your solution instance has been triggered\"\n },\n \"input_schema\" : { },\n \"output_schema\" : { }\n },\n \"steps_structure\" : [ {\n \"name\" : \"trigger\",\n \"type\" : \"normal\",\n \"content\" : { }\n }, {\n \"name\" : \"slack-1\",\n \"type\" : \"normal\",\n \"content\" : { }\n } ],\n \"steps\" : {\n \"slack-1\" : {\n \"title\" : \"Slack\",\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"7.0\"\n },\n \"operation\" : \"send_message\",\n \"output_schema\" : { },\n \"error_handling\" : { },\n \"authentication\" : {\n \"group\" : \"3e268690-xxxx-xxxx-xxxx-41a14d9248b4\",\n \"title\" : \"Mike Hewitt's Slack account\",\n \"service_icon\" : {\n \"icon_type\" : \"url\",\n \"value\" : \"//s3.amazonaws.com/images.tray.io/artisan/icons/c25033a972715dbbdb7e73ac79261230.png\"\n },\n \"service_id\" : \"aba1a078-xxxx-xxxx-xxxx-0b703b29e76d\",\n \"auth_app_id\" : \"70fce61a-xxxx-xxxx-xxxx-c3b26fe1a4c5\",\n \"scopes\" : [ \"chat:write:bot\", \"chat:write:user\" ]\n },\n \"properties\" : {\n \"link_names\" : {\n \"type\" : \"boolean\",\n \"value\" : false\n },\n \"reply_broadcast\" : {\n \"type\" : \"boolean\",\n \"value\" : false\n },\n \"parse\" : {\n \"type\" : \"string\",\n \"value\" : \"none\"\n },\n \"username\" : {\n \"type\" : \"string\",\n \"value\" : \"Tray.io\"\n },\n \"as_user\" : {\n \"type\" : \"boolean\",\n \"value\" : false\n },\n \"token\" : {\n \"type\" : \"jsonpath\",\n \"value\" : \"$.auth.access_token\"\n },\n \"channel\" : {\n \"type\" : \"string\",\n \"value\" : \"CEAC4886Q\"\n },\n \"text\" : {\n \"type\" : \"string\",\n \"value\" : \"{$.steps.trigger.solutionInstanceId} has been updated!\"\n }\n }\n },\n \"trigger\" : {\n \"title\" : \"Solution instance trigger\",\n \"connector\" : {\n \"name\" : \"solution-instance-trigger\",\n \"version\" : \"1.0\"\n },\n \"operation\" : \"webhook\",\n \"output_schema\" : { },\n \"error_handling\" : { },\n \"properties\" : {\n \"events\" : {\n \"type\" : \"object\",\n \"value\" : {\n \"updated\" : {\n \"type\" : \"boolean\",\n \"value\" : true\n }\n }\n }\n }\n }\n },\n \"dependencies\" : [ ]\n } ]\n}"
}
}
}

Importing Projects

The importProject mutation can then be used to import the Project to e.g. your 'production' account.

mutation importProject {
importProject (input: {
exportedProjectJson: "{\n \"export_type\" : \"project\",\n \"projects\" : [ {\n \"id\" : \"d9b41594-xxxx-xxxx-xxxx-ffff9bc9f25e\",\n \"name\" : \"Webhook demo\",\n \"config\" : {\n \"slack-channel\" : \"CE3KXDFTP\",\n \"slack-message\" : \"The webhook for your solution instance has been triggered\"\n },\n \"workflows\" : [ \"804c5f50-xxxx-xxxx-xxxx-9338c507ff45\", \"ddc64647-xxxx-xxxx-xxxx-5abc7296cfc2\" ],\n \"dependencies\" : [ ]\n } ],\n \"solution\" : {\n \"id\" : \"91c0f56f-xxxx-xxxx-xxxx-184686978ea5\",\n \"name\" : \"Webhook demo\",\n \"description\" : \"\",\n \"project_id\" : \"d9b41594-xxxx-xxxx-xxxx-ffff9bc9f25e\",\n \"tags\" : [ ],\n \"custom_fields\" : { },\n \"view_schema\" : {\n \"version\" : 6,\n \"screens\" : [ {\n \"id\" : \"af463e6f-xxxx-xxxx-xxxx-21f94285d65d\",\n \"hidden\" : true,\n \"items\" : [ {\n \"id\" : \"e1655697-xxxx-xxxx-xxxx-5aba5646b6c0\",\n \"itemType\" : 2,\n \"new\" : false,\n \"title\" : \"instance-trigger Public Url\",\n \"workflowId\" : \"ddc64647-xxxx-xxxx-xxxx-5abc7296cfc2\"\n } ],\n \"new\" : false\n }, {\n \"id\" : \"b71775ec-xxxx-xxxx-xxxx-9ab038c222f8\",\n \"new\" : false,\n \"items\" : [ {\n \"id\" : \"83aaeac6-xxxx-xxxx-xxxx-eb859f74b888\",\n \"itemType\" : 3,\n \"content\" : \"Workflow URLs\"\n }, {\n \"id\" : \"1f3d99a3-xxxx-xxxx-xxxx-ddcfc327555e\",\n \"itemType\" : 4,\n \"content\" : \"Below is the webhook url for your workflow instance\"\n }, {\n \"id\" : \"7571180d-xxxx-xxxx-xxxx-16064f7917a2\",\n \"itemType\" : \"SPACER\",\n \"unit\" : \"%\",\n \"height\" : 15\n }, {\n \"id\" : \"d330c064-xxxx-xxxx-xxxx-9822def81e36\",\n \"itemType\" : 2,\n \"new\" : false,\n \"title\" : \"Webhook demo Public Url\",\n \"workflowId\" : \"804c5f50-xxxx-xxxx-xxxx-9338c507ff45\"\n } ]\n }, {\n \"id\" : \"56a634da-xxxx-xxxx-xxxx-745bec347ba3\",\n \"items\" : [ {\n \"id\" : \"d147bea2-xxxx-xxxx-xxxx-9716da1b9d15\",\n \"itemType\" : 3,\n \"content\" : \"Slack authentication\"\n }, {\n \"id\" : \"c51528be-xxxx-xxxx-xxxx-a288876a3b30\",\n \"itemType\" : 4,\n \"content\" : \"Please create your Slack authentication and set the alerting channel and message\"\n }, {\n \"id\" : \"e63557cc-xxxx-xxxx-xxxx-143f485b1420\",\n \"itemType\" : \"SPACER\",\n \"unit\" : \"%\",\n \"height\" : 15\n }, {\n \"id\" : \"e20b5e3c-xxxx-xxxx-xxxx-9fe607ac7daa\",\n \"itemType\" : 0,\n \"new\" : false,\n \"buttonCTA\" : \"New authentication\",\n \"slot\" : {\n \"id\" : \"4eb7b636-xxxx-xxxx-xxxx-8f0227713362\",\n \"authId\" : \"03d1c064-xxxx-xxxx-xxxx-5d0ae56813f5\",\n \"serviceId\" : \"aba1a078-xxxx-xxxx-xxxx-0b703b29e76d\",\n \"authAppId\" : \"70fce61a-xxxx-xxxx-xxxx-c3b26fe1a4c5\",\n \"title\" : \"Slack authentication\",\n \"description\" : \"\",\n \"externalId\" : \"external_slack_authentication\",\n \"hidden\" : false,\n \"useExisting\" : false,\n \"static\" : false,\n \"scopes\" : [ \"users:read\", \"groups:write\", \"users:read.email\", \"channels:read\", \"chat:write:user\", \"files:read\", \"reminders:write\", \"channels:write\", \"groups:read\", \"chat:write:bot\" ],\n \"usage\" : [ {\n \"workflowId\" : \"ddc64647-xxxx-xxxx-xxxx-5abc7296cfc2\",\n \"versionId\" : \"16dc62e2-xxxx-xxxx-xxxx-0f6686532a1f\",\n \"steps\" : [ {\n \"stepName\" : \"slack-1\",\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"7.0\"\n },\n \"operation\" : \"send_message\",\n \"authId\" : \"03d1c064-xxxx-xxxx-xxxx-5d0ae56813f5\",\n \"properties\" : [ ]\n } ]\n }, {\n \"workflowId\" : \"804c5f50-xxxx-xxxx-xxxx-9338c507ff45\",\n \"versionId\" : \"63c9d498-xxxx-xxxx-xxxx-95600f3acc77\",\n \"steps\" : [ {\n \"stepName\" : \"slack-1\",\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"6.0\"\n },\n \"operation\" : \"send_message\",\n \"authId\" : \"03d1c064-xxxx-xxxx-xxxx-5d0ae56813f5\",\n \"properties\" : [ ]\n } ]\n } ]\n }\n }, {\n \"id\" : \"b35abbc0-xxxx-xxxx-xxxx-1a422a821ecc\",\n \"itemType\" : 1,\n \"new\" : false,\n \"slot\" : {\n \"id\" : \"2cc876d6-xxxx-xxxx-xxxx-dc9098bbdb12\",\n \"key\" : \"slack-channel\",\n \"title\" : \"slack-channel\",\n \"description\" : \"\",\n \"externalId\" : \"external_slack-channel\",\n \"hidden\" : false,\n \"type\" : \"string\",\n \"defaultValue\" : \"CE3KXDFTP\",\n \"required\" : true,\n \"useDefaultValue\" : false,\n \"static\" : false,\n \"authSlotId\" : \"4eb7b636-xxxx-xxxx-xxxx-8f0227713362\",\n \"ephemeralMetadata\" : {\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"6.0\"\n },\n \"operation\" : \"send_message\",\n \"ddlOperation\" : \"list_users_channels_groups_ddl\",\n \"propertyPath\" : \"channel\",\n \"dependencies\" : [ ],\n \"ephemeralMetadataType\" : \"Regular\"\n },\n \"usage\" : [ {\n \"workflowId\" : \"804c5f50-xxxx-xxxx-xxxx-9338c507ff45\",\n \"versionId\" : \"63c9d498-xxxx-xxxx-xxxx-95600f3acc77\",\n \"steps\" : [ {\n \"stepName\" : \"slack-1\",\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"6.0\"\n },\n \"operation\" : \"send_message\",\n \"authId\" : \"03d1c064-xxxx-xxxx-xxxx-5d0ae56813f5\",\n \"properties\" : [ {\n \"path\" : \"channel\",\n \"value\" : {\n \"type\" : \"jsonpath\",\n \"value\" : \"$.config.slack-channel\"\n }\n } ]\n } ]\n } ]\n }\n }, {\n \"id\" : \"c5e7205b-xxxx-xxxx-xxxx-03aedeae0162\",\n \"itemType\" : 1,\n \"new\" : false,\n \"slot\" : {\n \"id\" : \"4022a298-xxxx-xxxx-xxxx-50e5f9fc519a\",\n \"key\" : \"slack-message\",\n \"title\" : \"slack-message\",\n \"description\" : \"\",\n \"externalId\" : \"external_slack-message\",\n \"hidden\" : false,\n \"type\" : \"string\",\n \"defaultValue\" : \"The webhook for your solution instance has been triggered\",\n \"required\" : true,\n \"useDefaultValue\" : false,\n \"static\" : false,\n \"authSlotId\" : \"4eb7b636-xxxx-xxxx-xxxx-8f0227713362\",\n \"usage\" : [ {\n \"workflowId\" : \"804c5f50-xxxx-xxxx-xxxx-9338c507ff45\",\n \"versionId\" : \"63c9d498-xxxx-xxxx-xxxx-95600f3acc77\",\n \"steps\" : [ {\n \"stepName\" : \"slack-1\",\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"6.0\"\n },\n \"operation\" : \"send_message\",\n \"authId\" : \"03d1c064-xxxx-xxxx-xxxx-5d0ae56813f5\",\n \"properties\" : [ {\n \"path\" : \"text\",\n \"value\" : {\n \"type\" : \"jsonpath\",\n \"value\" : \"$.config.slack-message\"\n }\n } ]\n } ]\n } ]\n }\n } ],\n \"new\" : false\n } ]\n },\n \"auth_slots\" : [ {\n \"id\" : \"4eb7b636-xxxx-xxxx-xxxx-8f0227713362\",\n \"auth_group\" : \"3e268690-xxxx-xxxx-xxxx-41a14d9248b4\",\n \"service_id\" : \"aba1a078-xxxx-xxxx-xxxx-0b703b29e76d\",\n \"auth_app_id\" : \"70fce61a-xxxx-xxxx-xxxx-c3b26fe1a4c5\",\n \"title\" : \"Slack authentication\",\n \"description\" : \"\",\n \"external_id\" : \"external_slack_authentication\",\n \"hidden\" : false,\n \"use_existing\" : false,\n \"static\" : false,\n \"scopes\" : [ \"users:read\", \"groups:write\", \"users:read.email\", \"channels:read\", \"chat:write:user\", \"files:read\", \"reminders:write\", \"channels:write\", \"groups:read\", \"chat:write:bot\" ],\n \"usage\" : [ {\n \"workflow_id\" : \"ddc64647-xxxx-xxxx-xxxx-5abc7296cfc2\",\n \"version_id\" : \"16dc62e2-xxxx-xxxx-xxxx-0f6686532a1f\",\n \"steps\" : [ {\n \"step_name\" : \"slack-1\",\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"7.0\"\n },\n \"operation\" : \"send_message\",\n \"auth_group\" : \"3e268690-xxxx-xxxx-xxxx-41a14d9248b4\",\n \"properties\" : [ ]\n } ]\n }, {\n \"workflow_id\" : \"804c5f50-xxxx-xxxx-xxxx-9338c507ff45\",\n \"version_id\" : \"63c9d498-xxxx-xxxx-xxxx-95600f3acc77\",\n \"steps\" : [ {\n \"step_name\" : \"slack-1\",\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"6.0\"\n },\n \"operation\" : \"send_message\",\n \"auth_group\" : \"3e268690-xxxx-xxxx-xxxx-41a14d9248b4\",\n \"properties\" : [ ]\n } ]\n } ]\n } ],\n \"config_slots\" : [ {\n \"id\" : \"2cc876d6-xxxx-xxxx-xxxx-dc9098bbdb12\",\n \"key\" : \"slack-channel\",\n \"title\" : \"slack-channel\",\n \"description\" : \"\",\n \"external_id\" : \"external_slack-channel\",\n \"hidden\" : false,\n \"type\" : \"string\",\n \"default_value\" : \"CE3KXDFTP\",\n \"required\" : true,\n \"use_default_value\" : false,\n \"static\" : false,\n \"auth_slot_id\" : \"4eb7b636-xxxx-xxxx-xxxx-8f0227713362\",\n \"ephemeral_metadata\" : {\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"6.0\"\n },\n \"operation\" : \"send_message\",\n \"ddl_operation\" : \"list_users_channels_groups_ddl\",\n \"property_path\" : \"channel\",\n \"dependencies\" : [ ],\n \"ephemeral_metadata_type\" : \"Regular\"\n },\n \"usage\" : [ {\n \"workflow_id\" : \"804c5f50-xxxx-xxxx-xxxx-9338c507ff45\",\n \"version_id\" : \"63c9d498-xxxx-xxxx-xxxx-95600f3acc77\",\n \"steps\" : [ {\n \"step_name\" : \"slack-1\",\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"6.0\"\n },\n \"operation\" : \"send_message\",\n \"auth_group\" : \"3e268690-xxxx-xxxx-xxxx-41a14d9248b4\",\n \"properties\" : [ {\n \"path\" : \"channel\",\n \"value\" : {\n \"type\" : \"jsonpath\",\n \"value\" : \"$.config.slack-channel\"\n }\n } ]\n } ]\n } ]\n }, {\n \"id\" : \"4022a298-xxxx-xxxx-xxxx-50e5f9fc519a\",\n \"key\" : \"slack-message\",\n \"title\" : \"slack-message\",\n \"description\" : \"\",\n \"external_id\" : \"external_slack-message\",\n \"hidden\" : false,\n \"type\" : \"string\",\n \"default_value\" : \"The webhook for your solution instance has been triggered\",\n \"required\" : true,\n \"use_default_value\" : false,\n \"static\" : false,\n \"auth_slot_id\" : \"4eb7b636-xxxx-xxxx-xxxx-8f0227713362\",\n \"usage\" : [ {\n \"workflow_id\" : \"804c5f50-xxxx-xxxx-xxxx-9338c507ff45\",\n \"version_id\" : \"63c9d498-xxxx-xxxx-xxxx-95600f3acc77\",\n \"steps\" : [ {\n \"step_name\" : \"slack-1\",\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"6.0\"\n },\n \"operation\" : \"send_message\",\n \"auth_group\" : \"3e268690-xxxx-xxxx-xxxx-41a14d9248b4\",\n \"properties\" : [ {\n \"path\" : \"text\",\n \"value\" : {\n \"type\" : \"jsonpath\",\n \"value\" : \"$.config.slack-message\"\n }\n } ]\n } ]\n } ]\n } ]\n },\n \"tray_export_version\" : 3,\n \"workflows\" : [ {\n \"id\" : \"804c5f50-xxxx-xxxx-xxxx-9338c507ff45\",\n \"created\" : \"2020-09-29T18:52:03.437Z\",\n \"workspace_id\" : \"6c595d5b-xxxx-xxxx-xxxx-959ceb938eae\",\n \"project_id\" : \"d9b41594-xxxx-xxxx-xxxx-ffff9bc9f25e\",\n \"group\" : \"6e7e1eac-xxxx-xxxx-xxxx-9b10518391a8\",\n \"creator\" : \"6c595d5b-xxxx-xxxx-xxxx-959ceb938eae\",\n \"version\" : {\n \"id\" : \"63c9d498-xxxx-xxxx-xxxx-95600f3acc77\",\n \"created\" : \"2020-11-25T15:00:50.980Z\"\n },\n \"title\" : \"Webhook demo\",\n \"enabled\" : true,\n \"tags\" : [ ],\n \"settings\" : {\n \"config\" : {\n \"slack-channel\" : \"CE3KXDFTP\",\n \"slack-message\" : \"The webhook for your solution instance has been triggered\"\n },\n \"input_schema\" : { },\n \"output_schema\" : { }\n },\n \"steps_structure\" : [ {\n \"name\" : \"trigger\",\n \"type\" : \"normal\",\n \"content\" : { }\n }, {\n \"name\" : \"slack-1\",\n \"type\" : \"normal\",\n \"content\" : { }\n } ],\n \"steps\" : {\n \"trigger\" : {\n \"title\" : \"Webhook\",\n \"connector\" : {\n \"name\" : \"webhook\",\n \"version\" : \"2.2\"\n },\n \"operation\" : \"fire_and_forget\",\n \"output_schema\" : { },\n \"error_handling\" : { },\n \"properties\" : { }\n },\n \"slack-1\" : {\n \"title\" : \"Alert slack channel\",\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"6.0\"\n },\n \"operation\" : \"send_message\",\n \"output_schema\" : { },\n \"error_handling\" : { },\n \"authentication\" : {\n \"group\" : \"3e268690-xxxx-xxxx-xxxx-41a14d9248b4\",\n \"title\" : \"Mike Hewitt's Slack account\",\n \"service_icon\" : {\n \"icon_type\" : \"url\",\n \"value\" : \"//s3.amazonaws.com/images.tray.io/artisan/icons/c25033a972715dbbdb7e73ac79261230.png\"\n },\n \"service_id\" : \"aba1a078-xxxx-xxxx-xxxx-0b703b29e76d\",\n \"auth_app_id\" : \"70fce61a-xxxx-xxxx-xxxx-c3b26fe1a4c5\",\n \"scopes\" : [ \"chat:write:bot\", \"chat:write:user\" ]\n },\n \"properties\" : {\n \"link_names\" : {\n \"type\" : \"boolean\",\n \"value\" : false\n },\n \"reply_broadcast\" : {\n \"type\" : \"boolean\",\n \"value\" : false\n },\n \"parse\" : {\n \"type\" : \"string\",\n \"value\" : \"none\"\n },\n \"username\" : {\n \"type\" : \"string\",\n \"value\" : \"Tray Embedded\"\n },\n \"as_user\" : {\n \"type\" : \"boolean\",\n \"value\" : false\n },\n \"token\" : {\n \"type\" : \"jsonpath\",\n \"value\" : \"$.auth.access_token\"\n },\n \"channel\" : {\n \"type\" : \"jsonpath\",\n \"value\" : \"$.config.slack-channel\"\n },\n \"text\" : {\n \"type\" : \"jsonpath\",\n \"value\" : \"$.config.slack-message\"\n }\n }\n }\n },\n \"dependencies\" : [ ]\n }, {\n \"id\" : \"ddc64647-xxxx-xxxx-xxxx-5abc7296cfc2\",\n \"created\" : \"2020-11-11T14:34:00.298Z\",\n \"workspace_id\" : \"6c595d5b-xxxx-xxxx-xxxx-959ceb938eae\",\n \"project_id\" : \"d9b41594-xxxx-xxxx-xxxx-ffff9bc9f25e\",\n \"group\" : \"69f86944-xxxx-xxxx-xxxx-0a93d6b178b0\",\n \"creator\" : \"6c595d5b-xxxx-xxxx-xxxx-959ceb938eae\",\n \"version\" : {\n \"id\" : \"16dc62e2-xxxx-xxxx-xxxx-0f6686532a1f\",\n \"created\" : \"2020-11-11T14:37:10.303Z\"\n },\n \"title\" : \"instance-trigger\",\n \"enabled\" : true,\n \"tags\" : [ ],\n \"settings\" : {\n \"config\" : {\n \"slack-channel\" : \"CE3KXDFTP\",\n \"slack-message\" : \"The webhook for your solution instance has been triggered\"\n },\n \"input_schema\" : { },\n \"output_schema\" : { }\n },\n \"steps_structure\" : [ {\n \"name\" : \"trigger\",\n \"type\" : \"normal\",\n \"content\" : { }\n }, {\n \"name\" : \"slack-1\",\n \"type\" : \"normal\",\n \"content\" : { }\n } ],\n \"steps\" : {\n \"slack-1\" : {\n \"title\" : \"Slack\",\n \"connector\" : {\n \"name\" : \"slack\",\n \"version\" : \"7.0\"\n },\n \"operation\" : \"send_message\",\n \"output_schema\" : { },\n \"error_handling\" : { },\n \"authentication\" : {\n \"group\" : \"3e268690-xxxx-xxxx-xxxx-41a14d9248b4\",\n \"title\" : \"Mike Hewitt's Slack account\",\n \"service_icon\" : {\n \"icon_type\" : \"url\",\n \"value\" : \"//s3.amazonaws.com/images.tray.io/artisan/icons/c25033a972715dbbdb7e73ac79261230.png\"\n },\n \"service_id\" : \"aba1a078-xxxx-xxxx-xxxx-0b703b29e76d\",\n \"auth_app_id\" : \"70fce61a-xxxx-xxxx-xxxx-c3b26fe1a4c5\",\n \"scopes\" : [ \"chat:write:bot\", \"chat:write:user\" ]\n },\n \"properties\" : {\n \"link_names\" : {\n \"type\" : \"boolean\",\n \"value\" : false\n },\n \"reply_broadcast\" : {\n \"type\" : \"boolean\",\n \"value\" : false\n },\n \"parse\" : {\n \"type\" : \"string\",\n \"value\" : \"none\"\n },\n \"username\" : {\n \"type\" : \"string\",\n \"value\" : \"Tray.io\"\n },\n \"as_user\" : {\n \"type\" : \"boolean\",\n \"value\" : false\n },\n \"token\" : {\n \"type\" : \"jsonpath\",\n \"value\" : \"$.auth.access_token\"\n },\n \"channel\" : {\n \"type\" : \"string\",\n \"value\" : \"CEAC4886Q\"\n },\n \"text\" : {\n \"type\" : \"string\",\n \"value\" : \"{$.steps.trigger.solutionInstanceId} has been updated!\"\n }\n }\n },\n \"trigger\" : {\n \"title\" : \"Solution instance trigger\",\n \"connector\" : {\n \"name\" : \"solution-instance-trigger\",\n \"version\" : \"1.0\"\n },\n \"operation\" : \"webhook\",\n \"output_schema\" : { },\n \"error_handling\" : { },\n \"properties\" : {\n \"events\" : {\n \"type\" : \"object\",\n \"value\" : {\n \"updated\" : {\n \"type\" : \"boolean\",\n \"value\" : true\n }\n }\n }\n }\n }\n },\n \"dependencies\" : [ ]\n } ]\n}"
targetProjectId: "944da62c-xxxx-xxxx-xxxx-5c8ea222eb99"
}) {
clientMutationId
}
}

A successful import will simply return:

{
"data": {
"importProject": {
"clientMutationId": null
}
}
}

Testing the APIs

You can make use of our Insomnia collection to test out the APIs using the calls explained above.