Sequential Client ID Generation for Webhook Responses
Hi everyone!
I’m building a workflow where I receive form data through a webhook, and I need to generate sequential client IDs for each response.
What I want to achieve:
- Webhook receives form data
- Generate unique sequential IDs:
ROW_001
,ROW_002
,ROW_003
, etc. - Store the data with the generated ID in Google Sheets
- Each new webhook call should increment the counter automatically
Current approach:
I’m thinking of using Google Sheets to:
- Count existing rows to determine the next ID number
- Generate the formatted ID (ROW_XXX)
- Store the webhook data with the new ID
Questions:
- What’s the best way to ensure the counter doesn’t skip numbers or duplicate IDs?
- Should I use a separate “counter” sheet or count rows in the main data sheet?
- Any potential race condition issues if multiple webhooks arrive simultaneously?
Workflow structure I’m considering:
Webhook → Count Sheets Rows → Generate ID → Save to Sheets → Respond
Has anyone implemented something similar? Any suggestions for a robust solution?
Thanks in advance!