- Create a new Folder in step_library
- Create a package.yaml
- In Package.yaml, provide the name of your package
- Create a main.go
- go mod init <package_name>
- Import the SDK into main.go by running
go get github.com/apptreesoftware/go-workflow
from within the new package directory
- Create a new folder in step_library
- Create a package.yaml using the following template
- use the following template
name: json
version: 1.0
executables:
linux:
amd64: index-linux
darwin:
amd64: index-macos
windows:
amd64: index-windows.exe
steps:
<step_name>@1.0:
inputs:
<input1>:
required: true
description: The text you want to parse as JSON
sample: '{"key" : "value"}'
outputs:
<output1>:
description: The record that was parsed from the JSON string
- Create index.js
- Run
npm init
- Run
npm install apptree-workflow-sdk
- Write your step functions
- Register them with the SDK using
apptree.addStep()
- Install
pkg
using npm. Runnpm install -g pkg
cd
into the package folder- Run
pkg -t node12-linux-x64,node12-macos-x64 .
or 'pkg -t node12-linux-x64,node12-macos-x64 index.js'
cd
into the package folderapptree publish package -d . --host https://platform.apptreeio.com
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/<pkg_folder>/index.js",
"cwd": "${workspaceFolder}/<pkg_folder>",
"args": [
"--serve" //Optional if you want to run in serve mode
"--port" //Optional if you want to change the port
"5001"
]
}
]
}