Tutorial - Publish workflow

Rev 1.005, 23.12.19

How to read this tutorial


Your task would be to setup access to a folder here they grab work as assigned and perform their task. When they are done, subcontractor should be able to publish back results directly into the correct folder structure, with metadata that should be saved in production database and relevant notifications. 

Installing accsyn

The following guide is a short summary of the installation process described in detail here: accsyn Admin Manual

By now you have a fully working file transfer solution that can be used by external user to receive and send back large file packages at high speed (i.e. an accelerated encrypted FTP server replacement). We are now going to continue and make file transfers submitted by Python scripts to enable an automised workflow.

Configuring accsyn

Share material to test user

Note: This can be done using the accsyn Python API in an automated way upon task assignment in your production database systems. For hints on how to do this, please check this tutorial: Tutorial - Automated Production Outsourcing.

User will now get an invite, be instructed on how to install desktop application, and be to see share "TO_VENDORS" and folder "test@interpost.com" only within their accsyn. You can now copy work task source data into this folder in order to make it available to subcontractor.

Write pre-publish hook

We are now going to write the first hook out of two, the "job-pre-publish-server" hook as it is named with accsyn. Here is were you can validate the filenames remote user has supplied and return appropriate feedback.

accsyn provides the JSON data in a temporary file and then runs your configured script supplying the path to this data file. It also provides you a path to were you should write the result back in JSON format. This mechanism in Accsyn is called a "hook". 

In this tutorial, during the test, the user will drag-n-drop three files/directories resulting in the following publish data (this would be the data sent if using Python API for publish):



































The pre-publish Python script need to: 

Using a Python capable text editor such as IDLE++ or Sublime, copy this script from out Github:


The script should be quite self-explanatory if you are familiar with Python. Here follow  some explanations:

Configure pre-publish hook

Now we need to tell accsyn were to find our pre-publish hook script:

Note: Make sure Python3 is installed at the server and that python3 executable is in the PATH, for script to function.

Your accsyn is now ready to accept publishes and have them uploaded into the correct location.

Write publish hook

We now should write the publish hook script that gets execute after the files and directories have been uploaded to your server. This is of course optional and can be omitted if you do not wish to save user input (metadata) or do any other workflow integrations.

Note: These two publish scripts can be combined into one, by for example adding a --pre command line argument or similar.

The data that comes in are identical to to data arriving to your previous pre-publish script, except that user input/metadata has been appended:


Configure publish hook

Now finally we need to tell accsyn were to find our post-publish hook script:


This tutorial described how to setup publish hooks on Linux/Mac OSX compatible system, this applies to a Windows server based deployment:


Finally, we test it:

Your accsyn is now all setup for having your subcontractors become integrated in your workflow, in a safe, fast and user friendly manner! 


Any error that occur are displayed in the Job audit logs, log on to your workspace as a an admin and go to Admin>Audit>Job.

Log messages are also output in the accsyn deamon server log: