Add a database query step and use the aggregate functions to find the max value of a column. Add an alias for it:
Then add the insert step and select the alias from the query step: