All Collections
Integrations
Snowflake integration
Pushing stock orders into Snowflake
Pushing stock orders into Snowflake
S
Written by Sara Jaffer
Updated over a week ago

The stock orders push functionality allows you to save purchase orders, transfer orders and assembly orders to Snowflake, and potentially push them further into custom systems.

Using this feature requires additional INSERT and DELETE privileges on the corresponding stock orders table. INSERT is used to add rows, and DELETE is used to remove partial rows if any errors occur. The UPDATE privilege is not currently required.

The following is an example workflow to demonstrate the functionality.

  • A stock order is created in Inventory Planner based on replenishment recommendations in the Replenishment report. At this stage, the stock order only exists in Inventory Planner.

  • The “Save to…” button is clicked, sending the order to Snowflake. The Snowflake connector creates rows in the corresponding Snowflake table.

  • The stock order in Inventory Planner is marked as “Saved to Snowflake” and made read-only. Edits in Inventory Planner are no longer permitted, but the stock order can be edited in Snowflake.

  • Any updates to the stock order in Snowflake are synced to Inventory Planner, including the ordered and received quantities, similarly to other stock orders.

When Snowflake is integrated with a custom system (e.g. a WMS), the stock order can also be pushed there. The following is an example of how that may be implemented:

  • An EXTERNAL_ID column is added to the table. This column is used by the integration to synchronize changes from the custom system to Snowflake.

  • The integration detects a new stock order in the PURCHASE_ORDERS table which has not yet been pushed into the custom system.

    • The column is used to query stock orders:

      SELECT * FROM PURCHASE_ORDERS WHERE EXTERNAL_ID IS NULL
    • The process runs periodically or uses Inventory Planner webhooks which fire after a stock order is pushed to Snowflake

  • The rows are processed and flagged to be saved in the external system.

    • The EXTERNAL_ID is updated so the query above no longer processes these rows.

Did this answer your question?