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 them 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

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

It is not currently possible to make use of Solutions in custom workspaces. Hence the need for two embedded accounts.

Converting dev account to sandbox

You also need to convert the account you want to use for development and testing to a sandbox account to avoid billing for them. Here's how you can do this:

1 - Navigate to the settings page of your dev account.

2 - Go to workspaces and convert your organization to a sandbox.

embedded version control : sandbox account

This account won't be billed and can be used for developing and testing solutions before you are ready to promote them to the 'production' account.

Starting a project with version control

If you are importing a solution which has a Custom service, you will have to modify your exported JSON. Please see this page: Importing Solutions with a Custom Service for more details.

version-control-process-diagram

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.

export-project

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

new-project-no-workflow

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:

4 - When you first import the project you will be prompted to create your 'prod' authentications for the services included in the project's workflows

create-prod-auth

5 - 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:

overwritten-settings

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.

2 - 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

Version control for pre-existing Solutions

version-control-process-diagram-retro

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 projects 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

Importing solutions with a custom service

Importing a Solution which contains a Custom service is currently not fully supported. You need to manipulate your exported JSON manually and then import it into the destination account.

Example Setup

There is a solution in the source account with a Custom service 'Acme'. We have exported this project in a JSON file 'project_Source-account-project'.

Custom Service sourceAccountProject

If you import this project as is into the destination account, you will see the following error:

customService import error

To resolve this, follow the steps below:

Data limitation on Export size

Please note that the project export size is limited to 6 Mb. If your project exceeds this limit, the export would fail with a 502 status code. It is highly unlikely to exceed the 6 megabytes and it should suffice your needs for all practical purposes.

In case you face this issue, please cross verify all your workflows for any hardcoded information (example: A config variable which has been assigned a default value of a million of records. You will be able to run and test your solution just as good but you wouldn't be able to export it because the project size would exceed 6 Mb of data.)