One of the first things to greet you at the Boxed warehouse floor in Union, New Jersey, is a four-story-tall gray robot employees call the Opex.

It doesn't have any arms and legs -- it looks more like a massive metal-and-glass briefcase. Inside its glass-encased belly are 1,400 gray bins filled with 700 kinds of consumables, like vitamins and household cleaners, which it continually spits out to fill incoming orders.

A guy named Carlos Mercedes stands at the Opex's mouth to grab stuff out of the gray bins and transfer them into nearby red bins, each representing a box for a customer order. He then presses a button to move each red bin to its next destination along two miles of shiny metal conveyor belts snaking all around the 144,000-square-foot facility.

Video: Inside Boxed automated e-commerce warehouse

Boxed is a 4-year-old e-commerce startup based in New York City that's looking to become a mobile version of Costco, since it specializes in about 1,600 bulk items. As recently as March, workers like Mercedes were doing repetitive, unskilled jobs, like pushing carts down aisles to fill orders for diapers and crackers. But in April, the company flipped the switch on its multimillion-dollar, fully automated facility -- complete with a Willy Wonka-style spiral ramp the red bins get to slide down -- so it could respond to the crush of incoming orders.

The facility may have served as yet another example of automation stealing people's jobs. But instead, co-founder and CEO Chieh Huang decided to retrain most of the warehouse staff of roughly 100 people to work alongside their new machine co-workers.

"These are the folks that worked with us day in and day out during the early days," said Huang, a gregarious 36-year-old who wore black-rimmed glasses and a black Boxed T-shirt. "Because now, as the company becomes more successful and we can actually afford and design some of these robotics, it was not the right thing to do to say, 'Hey, we're not going to need you anymore.'"

Ben Fox Rubin/CNET

Boxed lays out a different route for companies looking to ramp up automation. Tech giants like Google, Amazon and Uber are racing to develop self-driving vehicles, warehouse robots and delivery drones that could endanger the jobs of truckers, cab drivers, laborers and delivery workers. The consulting firm PwC in March came out with a cheerily titled study "Will robots steal our jobs?" which predicted that as many as 38 percent of US jobs are at high risk of becoming automated in the coming decades.

Those automated systems could make things more efficient and make life easier for many people. But they may also kill off some of the lowest-rung jobs in the economy -- weakening the earning power of some of the least well-off and least skilled workers. These jobs might be tedious or dangerous or both, but it's worth asking: What are we supposed to do if robots take up all those positions?

"Automation is going to be an imperative soon for many retailers," said Yory Wurmser, a retail analyst for eMarketer, especially to keep up with e-commerce's rapid growth and its emphasis on speedy delivery.

Boxed shows that it's not an imperative to lose workers along the way.

Chinese food and Huang's garage

Huang was born in Taiwan and came to the US when he was a year old so his parents could pursue the American dream. Back in Taiwan, his mom was a teacher and dad was a general manager at a textiles business, but neither were strong English speakers when they first arrived in the States.

To support the family, his mom took a minimum wage cashier job at a Chinese restaurant in Baltimore, while his dad stayed home with the kids. His mother eventually found an administrative job in New Jersey and worked her way up to an executive vice president position at the company by the time she retired.

"She never gave up and is a bad-ass mom," he said.

In 2009, Huang co-founded Astro Ape Studios, a mobile gaming company that Zynga acquired. He and the other co-founders, many of whom he'd known since middle school in Edison, New Jersey, later left Zynga and, in 2013, started Boxed out of Huang's garage.

The company has raised $165 million in funding, according to Boxed. It went from $40,000 in sales its first year to more than $100 million last year, Huang said.

He said his working-class upbringing was one of the reasons he wanted to retrain Boxed's warehouse workers and not lay them off. Boxed's rapid growth is another reason why his company was able to hold onto its employees and shift their positions to fulfill new needs. That kind of quick expansion is also why Amazon, the biggest e-commerce company worldwide, has also been on a massive hiring spree despite its work building warehouse robots and other automated systems.

The New Jersey warehouse, built near the I-78 expressway in a suburb about 15 miles outside of New York City, is expansive, with a seemingly unending maze of conveyor belts carrying colorful red bins and yellow, teal and pink Boxed shipping boxes up and down aisles. The ceiling is high enough to comfortably house the Opex, several floors of workspaces and huge stacks of flattened Boxed boxes.

'Let the cart do all the work'

At the warehouse floor, Rick Zumpano, Boxed's vice president of distribution, shows me around the giant metal toys. It's loud with the constant drone of machines. Just behind the big gray Opex monster is a three-story structure crowded with pallets of larger items, like big round tubs of cheese balls and colossal mountains of paper towels, with conveyor belts cutting through each floor and workers walking around filling orders.

For Boxed's three other warehouses in the US, which haven't been automated, the company is developing a new robot called the AGV, or autonomously guided vehicle, which is a rolling cart tricked out with a tablet display, video array, lidar sensors and a Tesla battery.

"What we've replaced is human travel," said Zumpano, 45, who has broad shoulders, a bald head and, yes, looks a good bit like Mr. Clean. "Let the cart do all the work."

Boxed retrained the several dozen workers at the New Jersey location to work the Opex, troubleshoot the conveyor belts and use Boxed's new software for filling orders.

"It's a big change, but for good," said Veronica Mena, a 34-year-old packing manager, noting that her past work picking orders from shelves required much more heavy lifting.

Huang, though, doesn't think the work to automate more functions will stop any time soon.

"I can't name too many times when society and humans in general said, 'Stop with the technological advancement, we're happy where we are,'" Huang said. "It just seems like it's the course of history and we have to do our best to embrace it and to guide it rather than to have it dictate to us how it will affect society."

The Smartest Stuff: Innovators are thinking up new ways to make you, and the things around you, smarter.

'Alexa, be more human': Inside Amazon's effort to make its voice assistant smarter, chattier and more like you.