Hi,
The S3 side detection is up to you - we do not know how to detect it so you may ask Amazon support. Then, once you will have this code, it will continue in our API where you will create the document and work with it under advanced workflow - basically the workflow should be already defined so the newly created document will apply for the workflow. Then, the specified workflow actions should be executed automatically.
creating documents API[url= devnet.kentico.com/docs/devguide/documents_api_examples_managing_documents.htm]managing documents API[/url]
Best regards,
Juraj Ondrus