automating business processes with apis

20
Automating Business Processes with APIs Saul Caganoff CTO, Sixtree @scaganoff @APIdaysAU

Upload: saul-caganoff

Post on 16-Apr-2017

2.117 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Automating Business Processes with APIs

Automating Business Processes with APIs

SaulCaganoffCTO,Sixtree

@scaganoff @APIdaysAU

Page 2: Automating Business Processes with APIs

The Web is Now Programmable

• WeneedtotalkaboutconsumingAPIs• EachAPIwillhavethousandsormillionsofconsumers• Enterprisedigitalinitiatives– lean,SaaS,PaaS,IaaS• HowtoenabletheComposableEnterprise?

Page 3: Automating Business Processes with APIs
Page 4: Automating Business Processes with APIs

SaaS - Different Levels of Specialization

• Infrastructure– storage,compute,management,integration• Commodity – people,places,things,payment,security…• Functional – sales,marketing,servicemanagement,financial,humanresources…

• Industry – healthcare,education,supply-chain…• Youruniquebusinessvaluedependsonhowyouintegrateandoperatealltheseservices– Theend-to-endbusinessprocess

Page 5: Automating Business Processes with APIs

iPaaS & Cloud BPM

Consumer

Enterprise CloudBPM

DataSync

Page 6: Automating Business Processes with APIs

This is what you want…• Thebusinessprocessensemble• CoordinationbetweenprocessandAPI?• APIisconstrainedbyitsunderlyingstatemodel• BusinessProcesshasitsowngoaltoachieve

Page 7: Automating Business Processes with APIs

This is what you get…

• EachSaaSisbuiltasanisland…orwithpointintegrations

• Notdesignedforintegration• Anawfullotofpollinggoingon

“We’vegotalongwaytogo”- @njyx

Page 8: Automating Business Processes with APIs

E.g. Bookstore

Finance

Sales

Fulfilment

Product

Customer

Page 9: Automating Business Processes with APIs

End-to-end Process

?

Page 10: Automating Business Processes with APIs

State: the “S” in REST

• Created• Composed• Addressed• Quoted• Paid• Confirmed• Declined• Cancelled

Page 11: Automating Business Processes with APIs

Created Populated Addressed Quoted

PaidDeclined ConfirmedCancelled

AddItem

AddItem

RemoveItem

Accepted

AddCreditCardDetails

AddAddress

CalculateCost

Declined

AddCreditCardDetails

Cancel Cancel Cancel Cancel

Cancel

Page 12: Automating Business Processes with APIs

HATEOAS

• StateModel• BusinessProcess=apaththroughthestatemodel• APIAffordances– Exposehyperlinksthatrepresentavailablestatetransitions

Page 13: Automating Business Processes with APIs

HATEOAS

EmptyCart

FullCart

Quoted

Paid

POST/cart

PUT/cart/:id{book:…}

PUT/cart/:id{book:…}

DELETE/cart/:id/books/:id

PUT/cart/:id{address:…}

POST/payments{cart:…,card:{…}}

Commands{create:{cart:…}…}

{add:{cart:…,book: {…}}..}

{add:{cart:…,book: {…}}..}

{del:{cart:…,book: {…}}..}

{quoted:{cart:…}…}

{paid:{cart:…}…}

Events(EATNOAS)

Page 14: Automating Business Processes with APIs

HATEOAS and Events• StateModel• BusinessProcess=apaththroughthestatemodel• Dualitybetweenstatetransitionsandevents• Anexternalobservercaninferthestateofaresourcefromitsevent-stream– Thisistheessenceofevent-sourcing&CQRS

• Affordances– Exposehyperlinksthatrepresentavailablestatetransitions– Publisheventsthatnotifyactualstatetransitions

Page 15: Automating Business Processes with APIs

Event Transports: Syndication• APIexposeslistofevents– e.g.anRSS/atomfeed• Consumersdoallthehardwork:– Subscription– StateManagement(whereamIupto?)– Retries

• Positives– Veryeasy…well-knownpattern

• Negatives– Polling– Highlatency

Page 16: Automating Business Processes with APIs

Event Transports: WebHooks• ServicePOSTseventstosubscribers• Publishersdoallthehardwork:– Subscribermanagement– Consumersmustprovideanendpoint

• Positives– Notpolling,relativelylowerlatency

• Negatives– Subscriptionmanagement&guaranteeddeliverymustbedoneyourself– Reliability requirescoordinationbetweenpublisher&subscriber

Page 17: Automating Business Processes with APIs

Check out RESTHooks

• SponsoredbyZapier• WebHooks with• RESTful SubscriptionManagement

resthooks.org

Page 18: Automating Business Processes with APIs

Notification Services

Page 19: Automating Business Processes with APIs

End-to-end Process

UpdateInventory

ProcessPayment

InitiateFulfilment

UpdateFinancials

CompleteOrder

Page 20: Automating Business Processes with APIs

Affordances for Business Automation

• HaveanexplicitStateModel–Withpublishedhypermediacontrols

• Trackchanges– Allowqueryofchangessincelast“poll”

• Evenbetter- notifychanges– Eventstreams–WebHooks orRESTHooks– NotificationServices

• Considertheimportanceofeventreliability