Developing code steps in a workflow locally?

FWIW, answering my own question:

https://pipedream.com/docs/cli/reference/#command-reference

to start:

pd dev myFile.js

to edit:

pd dev --dc {{job_id}} myFile.js

workflow is really nice… here’s a template i used to get started, just in case it helps anyone else


export default {
    name: "my source name",
    version: "1",
    description: "my source description",
    props: {
        http: {
            type: "$.interface.http",
            customResponse: true
        }
    },

    //methods written outside of run get hooked in here!
    methods: { bar },
    
    //lifecycle hooks if needed; called by pipedream when your source changes
    hooks: {
        async activate() {},
        async deactivate() {},
        async deploy() {},
    },
    
    //this runs inside pipedream with every invocation    
    async run(event) {
     
        const foo = this.bar
        
        //respond to invocation
        this.http.respond({
            status: 200,
            body: foo
        });

        //emit data for workflow
        this.$emit(foo);
    },
};

//methods can go here
function bar() {
    return `foo!`
}

function test(){
    return
}

//you can also run stuff outside of pipedream locally for testing, etc...
test(bar)