I was experimenting with this just this morning, so I figured I would put up an example repo to show you how I got a basic Gulp task running.
config.rb file, you'll need to define your external pipeline settings. Here are mine. (note that I also set my images path to point to the post-minfied images directory & I'm also ignoring the pre-minified images directory on build)
The way I understood these configs was:
name gets set to...the name of your external pipeline task,
command is the command that you want to run (in mine, I set this to my default Gulp task - unless I'm building, then I run my buildProd task) with the pointers to the associated Node module(s).
For your reference, I was following this: https://github.com/middleman/middleman-guides/commit/1a253a1ea5b9915a0cc10610f859813e41767854
Hopefully, that sets you in the right direction. I'm sure we'll gain more insight on this as more folks use v4, but I was happy to see that I could get things working with my initial stab at this!