ALTERYX INSPIRE | Join us this May for for a multi-day virtual analytics + data science experience like no other! Register Now
The Alteryx Community will be temporarily unavailable for a time due to scheduled maintenance on Thursday, April 22nd. Please plan accordingly.

Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Issue running workflow on gallery that works in designer

7 - Meteor

I have created a macro that does the following: 

  1. Reads in data and saves it to a csv at a specified location so it can be read by the next steps
  2. Reads in a .pem private key file from a specified location on the users computer and connects to an sftp using this
  3. Uploads a file to the sftp 

The python for this is as follows. It works in designer but I'm having issues in porting it to the gallery to be scheduled. 


from ayx import Package
import pysftp as pysftp
import pandas as pd

from ayx import Alteryx
data ="#1")

data.to_csv( 'LOCAL_LOCATION' , encoding = 'utf-8', index = False)

def sftpPush():
        cnopts = pysftp.CnOpts()
        cnopts.hostkeys = None
        sftp = pysftp.Connection(host="HOSTNAME", username="USERNAME", private_key="PRIVATEKEY_LOCATION", port='PORT', cnopts=cnopts)
        sftp.put('LOCAL_LOCATION', 'LOCATION_ON_SFTP')
        # hostname, username and port are usually filled in but have been removed for security here. 
        #The rest is provided by macro inputs

    except Exception as e:



My problems are: 

  1. The .pem private key file is not being picked up a workflow dependency, and as it sits on users' local PCs, it is not accessible from the gallery. Is there a way to package it in with the workflow? 
  2. Ideally, I wouldn't want to save datasets locally before uploading them to the sftp - this isn't that important but it would be nice. 


Thanks in advance for your help!




@JonnyR You have to add an asset to the workflow using the input tool. When you upload the workflow, it will show up as an asset and you will be able to package it when uploading to the gallery.