I am working in the Asset workflow automator to create a Purchase order when a consumable inventory is low. I have been able to create and test every step of my automator successfully except for the webhook to create the purchase order. I have ended up using the advanced payload so that I could specify different items from a web request to filter assets based on the name and type to get the available quantity data. I have set the asset type to consumable on creation of the workflow and as such it should have the context of the asset type id available.
This is the basic configuration:
The payload for the body is as follows, utilizing some of the parsed fields to make this as dynamic as possible:
{
"vendor_id": {{P1.root.assets.assets_object.type_fields.vendor_21000057429}},
"name": "Purchase Order for{{P1.root.assets.assets_object.name}}",
"po_number": "AutoPO - {{current_date_and_time}}",
"vendor_details": "string",
"shipping_address": "{{asset.requester.address}}",
"billing_same_as_shipping": true,
"billing_address": "{{asset.requester.address}}",
"currency_code": "USD",
"discount_percentage": 1,
"tax_percentage": 2,
"shipping_cost": 10,
"custom_fields": {},
"purchase_items": s
{
"item_type": {{P1.root.assets.assets_object.display_id}},
"item_name": "{{asset.name}}",
"item_id": {{P1.root.assets.assets_object.id}},
"cost": 0.99,
"quantity": 1,
"tax_percentage": 2
}
]
}
This allows for the proper creation of the Purchase order and testing this body in Postman does create a PO (if I fill in the placeholders). I have no errors in the execution log, and I have email actions in the automator to track the progress of this. There is no response code on the webhook at all. I am wondering if I need a specific automator setup that will expect parameters to be sent in the call and then utilize those parameters to create the PO.
Using a web request does work with the exact same package.