When building applications that are integrated with Salesforce, one of the choices you have to make is how you get data out of Salesforce and into your app. You can use one of the many ETL tools on the market, you can poll for changed records, use the Force.com Streaming API, use Apex HTTP Callouts from Salesforce or Outbound Messages.
I've covered most of these approaches in the past but have purposefully
overlooked Outbound Messages. Why? Because, in general, I hate working with XML. Perhaps it harkens back to my SAP days but every time I have to traverse an XML structure, I think a kitten dies somewhere.
You can find all of the code for this application at my github repo. What follows is the interesting part that catches the XML and parses it in routes/obm.js.
Now we need to setup the Workflow and Outbound Message that will send the data to your NodeJS application. You'll want to change the Workflow to meet your criteria as this one fires every time a Contact record is created or updated and the mobile phone is not blank.
The actual Outbound Message below defines the endpoint (you'll notice I'm running it locally using ngrok), the fields from the record to include in the message (the record Id and MobilePhone) and finally "Send Session ID" is checked. You'll probably want to include the Session ID so that you can grab it from the message and use it to quickly make calls back into Salesforce using something like nforce.
If you want to test the application locally you can use something like ngrok to securely expose your local web server. Salesforce (thankfully) requires that all endpoints use HTTPS so ngrok comes in handy.
Now if you modify a Contact record in Salesforce, you should see the following in your terminal if everything is configured correctly:
There's also a mocha test you can run to ensure that the XML is being parsed correctly.
There you have it... a simple NodeJS app to get you started using Outbound Messages from Salesforce.