<PAGE>
                                                                   EXHIBIT 10.31

June 14, 2004



Mr. Michael D. Perry


Dear Michael:

I am writing this letter to you on behalf of Vitria's Board of Directors and
Dale Skeen, Acting CEO, to extend to you an offer to become Senior Vice
President and Chief Financial Officer of Vitria Technology, Inc. To insure that
there is no uncertainly with regard to terms and conditions, I will outline them
below:

     1.   POSITION. Upon acceptance of Vitria's offer, you will become a Senior
          Vice President and the Chief Financial Officer of Vitria Technology,
          Inc.

     2.   BASE SALARY. You shall be paid a base salary at the rate of $250,000
          per annum, subject to annual review by the Board of Directors after
          our current year ends. Salary will be payable on the 15th and 30/31st
          of each month.

     3.   BONUS. Vitria will pay you a performance bonus for the year ending
          December 31, 2004 at the discretion of the Board of Directors.
          Assuming satisfaction of your performance objectives for such year,
          your bonus potential for fiscal 2004 shall be in the range of 50% of
          your annualized base salary. For subsequent years, your bonus will be
          based on an executive compensation plan that you will have the
          responsibility for developing and submitting to the Board of Directors
          for approval. In consultation with the Compensation Committee of the
          Board of Directors, you will develop a rational bonus program for the
          employees of Vitria including the Senior

<PAGE>

          Management. Program. This plan will follow the outline of a program
          that will include as a major element, a multi-year feature in which
          the breakeven point will be a function of the return on shareholders
          equity after a deductible which will reflect a basic return to the
          shareholders.

     4.   BENEFITS AND VACATION. You shall be entitled to participate in all
          benefit programs that Vitria establishes and makes available to its
          employees. You shall be entitled to four (4) weeks paid vacation per
          year. Although your employment will be "at will," should Vitria hire a
          CEO who brings along his own CFO causing your displacement, the
          company will pay you six months of salary as a termination allowance.

     5.   OPTIONS. Upon your acceptance of this letter, Vitria shall grant to
          you options for 200,000 shares of its Common Stock under its 1999
          Stock Option Plan at an exercise price equal to the last reported sale
          price of the Common Stock on the business day preceding the day on
          which you accept this letter. Such option shall become exercisable,
          depending on your continued employment with Vitria, at the rate of 25%
          at the end of 12 months and 6.25% at the end of each three-month
          period thereafter.

     6.   NON-COMPETE. While you are employed by Vitria and for a period of one
          year after the termination of your employment, you shall not, directly
          or indirectly, (i) engage in the business of developing, making or
          selling any product competitive with any product being developed, made
          or sold by Vitria while you were employed by Vitria or (ii) recruit or
          solicit any employee of Vitria to leave Vitria.

     7.   INDEMNIFICATION. The indemnification provided to you by Vitria as an
          officer shall continue after termination of your employment for all
          acts occurring during the period of your employment.
<PAGE>
     8.   INVENTION AND NON-DISCLOSURE AGREEMENT. You shall sign Vitria's
          standard Invention and Non-Disclosure Agreement.

This offer of employment will remain open until 6:00 P.M., on June 15, 2004. To
accept this offer, please sign in the appropriate space below, whereupon this
letter shall become a binding agreement between Vitria and you.

Mike, all of us who have talked to you and spent time with you are thrilled with
the thought of your joining Vitria; and we look forward to working with you in
the coming years. If there are any questions about any part of this letter,
please give me a call at your earliest convenience.

Sincerely,

VITRIA TECHNOLOGY, INC.

/s/ Robert M. Halperin

Robert M. Halperin
Chairman of the Board


Accepted:  /s/ Michael D. Perry
           -----------------------------------
           Michael D. Perry


Dated:     June 14, 2004
           -----------------------------------