Triggering Process With Email

Hi All,

I have a requirement where i need to trigger my Process Model only after Email is received from two different sources,

One Email will contain the information in the body while other email will have the data in an attachment. I need to trigger the sub process only when data is received from both the sources.

Kindly Suggest how can I configure such behavior

Thanks,

Gaurav Singh

  Discussion posts and replies are publicly visible

  • I'm sure there are a variety of patterns to address this, but here's one possible pattern:

    1. 1st Email received triggers Process Model A that writes the content of the body to a database table, along with a correlation token (something unique that both emails share in common)
    2. 2nd Email triggers Process Model B that stores the attachment as an Appian document, and writes an entry to a database table that holds the new Document Id and also the same correlation token value as described in Step 1.
    3. A Process Model that runs on a regular basis (e.g. every hour) looks to see if there are any entries in the Database that indicate that both emails for a given Case have been received. If so, it starts the sub-process you describe, passing it the necessary data. 
    4. The sub-process completes, and either deletes or marks the data in the database as having had a case completed so that the next time the regular process runs it doesn't submit a duplicate process

    A alternative process-centric pattern would have process models that get triggered by the incoming emails and send messages to a process instance that is waiting (this gets more complicated because I assume the emails could come in either order - Body then Attachment, or Attachment then Body), but the principle would be the same - you'd need to have a process to receive each email, some correlation token value that would help you find if a waiting process existed and route to it if it did, or start it if it didn't.

  • Have a logic to check for common (unique) thing among both emails  .... example Customer Id.
    When this common field is received from two emails, then kick the subprocess