//native
/**
* Get Workflow
* Retrieve one workflow with its actions and enrollment settings (legacy v3 API). Requires the automation scope and a Professional or Enterprise subscription.
*/
export async function main(auth: RT.Hubspot, workflow_id: string) {
const url = new URL(
`https://api.hubapi.com/automation/v3/workflows/${workflow_id}`
)
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${auth.token}`,
Accept: "application/json",
},
})
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return await response.json()
}
Submitted by hugo989 4 hours ago