A workflow that updates Pipedrive (CRM) when a new user signs up and notifies the internal team via slack. If the user is an existing lead info is updated in Pipedrive, otherwise a new deal is created and a reminder sent to the team 2 days later to follow up.
The boot.js
file is where you tell the Zenaton Agent where to find - by name - the source code of your tasks and workflows.
If you add a task or a workflow to your project, do not forget to update the
boot.js
file.
Look at Zenaton documentation to learn how to implement workflows and tasks.
A Zenaton account.
This example project uses Pipedrive API to sync your user data and Slack API to send a notification.
Before getting starting, make sure you have a Slack Incomming Webhook URL available to send the Slack notification. If you don't have one yet, you can read the dedicated Slack documentation to set up one.
You will also need a Pipedrive API key. If you don't have one yet, you can sign-in to your Pipedrive account and get an API token here.
You can dispatch the workflows by name from within your application using Zenaton API. They will be processed as soon as you run this project.
Note: Workflows are dispatched in an environment (
AppEnv
) of your Zenaton application (AppId
). They will be processed by this project, if you set it up with the sameAppId
andAppEnv
. You must also provide anApi Token
to authorize access to this application (found at https://app.zenaton.com/api)
First, install dependencies:
npm install
Then, fill-in the environment variables referenced in the .env
file.
Install a Zenaton Agent:
curl https://install.zenaton.com | sh
and run it:
zenaton listen --boot=boot.js
Follow this button , then fill in the env variables and click "deploy".
Create your .env
file
cp -n .env.sample .env
and fill-in the environment variables referenced in the .env
file.
Then start your container:
cd docker && docker-compose up
Check our documentation for more options (AWS, Google Cloud, Clever Cloud ...)
Whatever your installation method, you should see that a new Agent is listening from this url: https://app.zenaton.com/agents. If you do not see it, please check again that you have selected the right application and environment.
The workflows can be dispatched by name from within your application using the Zenaton API or our Node.js SDK.
You can test it from your command line interface:
Dispatching a PipedriveSync
workflow:
curl --request POST \
--url https://gateway.zenaton.com/graphql \
--header 'authorization: Bearer <API_TOKEN>' \
--header 'content-type: application/json' \
--data '{"query":"mutation($input: DispatchWorkflowInput!) {\n dispatchWorkflow(input: $input) {\n id\n }\n}\n ","variables":{"input":{"appId":"<APP_ID>","environment":"dev","name":"PipedriveSync","input":"[{\"name\": \"John Cibot\", \"email\": \"[email protected]\", \"org_name\": \"Piedpiper\"}]"}}}'
Do not forget to replace
<APP_ID>
and<API_TOKEN>
by your Zenaton AppId and api token.
Check your Zenaton dashboard (if you do not see your dispatched tasks or workflows, please check that you have selected the right application and environment).