Learn how to run your converted workflows programmatically on your own website, application, or backend.
Your API key authenticates your requests. It uses the prefix pmt_ for security.
PROMATLY_API_KEY).Every workflow has a unique 24-character hexadecimal identifier.
6a2e5ae1560dfbda674f4a48).Trigger your workflow by sending a secure HTTPS POST request containing inputs mapping to the first step of your workflow.
Bearer pmt_your_api_key_hereapplication/jsonProvide inputs for execution inside an inputs dictionary object.
Select your language below to copy the drop-in code for triggering execution from your application:
curl -X POST "https://www.promatly.com/api/zapier/workflows/YOUR_WORKFLOW_ID/run" \
-H "Authorization: Bearer pmt_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"inputs": {
"user_message": "Hello, please format my prompt",
"model_type": "gpt-4o-mini"
}
}'
const fetch = require('node-fetch'); // Required for Node.js < 18
async function triggerWorkflow() {
const workflowId = 'YOUR_WORKFLOW_ID';
const apiKey = 'pmt_YOUR_API_KEY';
const url = `https://www.promatly.com/api/zapier/workflows/${workflowId}/run`;
const response = await fetch(url, {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
inputs: {
user_message: 'Hello, please format my prompt',
model_type: 'gpt-4o-mini'
}
})
});
const data = await response.json();
if (data.ok) {
console.log('Workflow Output:', data.output);
} else {
console.error('Execution Error:', data.error);
}
}
triggerWorkflow();
// Use this to run workflow directly via browser or web client (make sure API key is proxy-hidden)
async function runPromatlyWorkflow(workflowId, inputs) {
const response = await fetch(`https://www.promatly.com/api/zapier/workflows/${workflowId}/run`, {
method: 'POST',
headers: {
'Authorization': `Bearer pmt_YOUR_API_KEY`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ inputs })
});
const data = await response.json();
if (!response.ok || !data.ok) {
throw new Error(data.error || 'Workflow execution failed');
}
return data.output;
}
import requests
def run_workflow(workflow_id, api_key, inputs):
url = f"https://www.promatly.com/api/zapier/workflows/{workflow_id}/run"
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
payload = {
"inputs": inputs
}
response = requests.post(url, json=payload, headers=headers)
data = response.json()
if response.status_code == 200 and data.get("ok"):
return data.get("output")
else:
raise Exception(data.get("error", "Unknown error during execution"))
# Example Usage
# result = run_workflow("YOUR_WORKFLOW_ID", "pmt_YOUR_API_KEY", {"user_message": "test"})
# print(result)
If you used Promatly to generate a custom Zapier integration (via the Zapier CLI export), follow these steps to deploy it to your Zapier account.
Download the .zip file from your Promatly dashboard. Right-click the file on your computer and select Extract All.
Open Windows PowerShell and navigate into the extracted folder:
cd "C:\path\to\your\extracted\migrated-zapier-project"
You must install the global Zapier CLI tool, and then install the specific local packages required for your workflow to build.
npx npm install -g zapier-platform-cli
npm install
Securely connect your terminal to your Zapier account and register your new custom app.
npx zapier-platform-cli login
npx zapier-platform-cli register "My Custom Promatly Workflow"
Follow the prompts to enter your email, password, and categorize your app (e.g. "Public", "HR").
Upload your code to Zapier so it becomes a live app.
npx zapier-platform-cli push
Once your terminal says "Push complete", your app is officially live on Zapier!
{
"ok": true,
"output": {
"result": "Formatted output from the final step of your workflow",
"status": 200
}
}
{
"ok": false,
"error": "Error executing step 17 (Format Prompt): Cannot read properties of undefined (reading 'final_prompt')"
}