For quite some time, when our customers asked to import "Save for Later" actions into our app, our answer was a polite "Hmm. Not feasible". It was a reasonable request, but one that wasn't supported natively by our import tool. The process was always the same: we'd thank them for the feedback and add it to a long product backlog, knowing it would be months, if ever, before our developers could build a solution.
Recently, that changed. Faced with the same request involving nearly 600,000 Save for Later actions, it was a deal breaker for the customer. Instead of saying no, we said, "Let's try something." In just a few hours, without pulling in a single developer from our product team, we had a robust, working import solution. How? By pairing up with Gemini.
This wasn't just about getting a task done; it proved that a new way of working is possible.
The Challenge: A Multi-Step Data Puzzle
The goal sounded simple. Take a customer's CSV file and import their users' Save for Later items into our system. But the details were complex:
The customer's file had the user's email and the Shopify Product ID, but it was missing the Variant ID, which is crucial for our APIs.
The dataset was huge—600,000 actions spread across 10,000 unique products.
The import itself required a precise, four-step API dance for every single user: generate a session, check for an existing list, create one if needed, and finally, add the items.
Doing this manually was impossible, and building a one-off tool would traditionally be a significant development project.
The Journey: Building It, One Step at a Time
Here’s how we tackled it, piece by piece, with the AI acting as a patient, expert developer.
Phase 1: Enriching the Data with Shopify’s API
Our first hurdle was fetching the missing variant_id
for the 10,000 unique products.
Gemini immediately pointed us to Shopify's Bulk Operation API—the right tool for any large-scale data job. It wrote a Python script to handle the process, but this is where the real collaboration began. We didn't just get a script; we learned as we went. We hit errors, and Gemini helped us debug them.
A
KeyError
taught us about API permissions and how to create a custom Shopify app with the right "scopes."A
400 Bad Request
error taught us about missing parameters in an API call.A
TypeError
when we scaled up to thousands of products taught us about API query length limits and led us to the solution: batch processing.
With each step, the script became more robust, finally evolving into a powerful tool that could reliably fetch data for all 10,000 products in minutes.
Phase 2: Assembling the Final File
With our new "lookup table" of variant IDs, we needed to merge it back into the main 600,000-row file. Gemini suggested using the pandas
library and provided a clean, efficient script to perform the merge, ensuring the row order was preserved for our final import.
Phase 3: The Final Import
This was the most complex part. We had to orchestrate the four API calls for what could be tens of thousands of unique users. Gemini helped us structure the logic to be incredibly efficient:
Group by User: Instead of 600,000 loops, the script intelligently grouped the data by email, processing each user only once.
Conditional Logic: It seamlessly handled the "if-then" logic: if a user has a list, use it; if not, create one.
Robust Logging: For a process that would run for hours, we knew we couldn't just watch the terminal. Gemini built a detailed logging system, creating a progress summary and a separate file for any failed items, making the entire process transparent and manageable.
Bridging the Gap: From Local Script to Production Environment
The final challenge wasn't about code. It was about the practicality of the script running. A script that needs to run for over days can't live on a personal laptop. It needed a home on a stable, production-grade server—in our case, the Azure node.
As a non-developer, accessing this kind of environment felt like a major roadblock. This is where another crucial partnership came into play—this time with our DevOps team.
We explained the goal and the tool we had built. With their help, what seemed like a complex technical barrier became a simple, straightforward step. They provided access and guidance with minimal effort, empowering us to take our solution to the finish line. It proved that when a clear business need is met with cross-team collaboration, technical hurdles disappear.
The Realization: It's More Than Just Writing Code
The "magic" wasn't just that an AI could write Python scripts. It was the collaborative process. It was the speed of iteration. A bug that might have taken hours to diagnose was solved in seconds.
This journey proved two things:
We are more capable than we think. Tasks that once seemed out of reach for non-developers are now achievable. We can be more responsive to customer needs without immediately burdening our engineering team.
This is a new partnership. Working with an AI isn't about replacing our skills; it's about augmenting them. It’s like having a senior developer available 24/7 to help you think through a problem, write the boilerplate, and spot the mistakes.
The result? We turned a request that would have been rejected into a success story. And more importantly, we’ve unlocked a new, faster, and more creative way to solve problems for our customers.
Awesome @Dhanush. This is a powerful message, packed into a neat story. Impressive!!