Spin up an EC2 instance from within the application
Use AWS API to spin up the instances. There are SDKs (Software Development Kits) for various languages, for example if you're using Python use boto3 library. SDKs for other platforms are also available: Tools to Build on AWS, including the command line tools AWS-CLI for use in shell scripts.

With the SDK of choice you'll simply call something like ec2.start_instance(...) to spin up your new EC2. 

However I would question whether you really need standalone EC2 instances for your processing? Perhaps ECS Containers, especially Fargate, or even serverless lambda functions triggered from a work queue may be a better choice?

Hope that helps :)