Dify integration
Connect Dify apps to remote AI execution
Dify handles AI app building and agentic workflow logic. Jungle Grid handles remote AI workload execution when an app needs heavier inference, batch work, or fine-tuning outside the app runtime.
Dify
AI app builder and agentic workflow platform.
Remote execution
Remote execution service behind the app or workflow.
AI apps that need an external execution service for bigger or longer-running jobs.
Open Dify docsDify organizes app flow, tools, and agentic workflow logic.
Jungle Grid runs remote inference, batch work, or other heavier AI jobs.
Useful when an AI app needs to leave the app layer for a tracked remote job.
How it works
How Dify and Jungle Grid work together
Dify is useful for building the AI application itself: app flow, prompts, external tools, and user-facing logic. When a Dify workflow reaches a task that is better handled as a remote workload, Jungle Grid can be used as the execution layer behind that step.
Instead of turning Dify into an execution backend, the cleaner pattern is to call Jungle Grid as an external API or tool, then bring status and results back into the Dify app once the workload completes.
- Use Dify to manage app behavior and tool orchestration.
- Submit heavy jobs to Jungle Grid as an external API or tool call.
- Return results, logs summaries, and failure states back into the Dify app flow.
Dify stays in charge of orchestration
Dify handles AI app and workflow logic. Jungle Grid handles remote AI workload execution.
Keep workflow state, app behavior, and orchestration inside the integration tool. Use Jungle Grid when the job itself should run remotely with tracked status, logs, and results.
Architecture flow
Where Jungle Grid fits in the stack
Dify owns the AI app experience. Jungle Grid owns the remote workload runtime behind the app.
User / Agent / Workflow
A user action or system event starts the process that needs remote AI execution.
Integration tool
The orchestration layer validates input, manages state, and decides when a remote job should run.
Jungle Grid API
The workflow layer submits a workload request and receives a tracked job identifier back.
Remote AI workload execution
Jungle Grid handles placement, execution, provider capacity, and lifecycle control for the job.
Status + logs + result
The integration layer polls state, reads logs, and collects result payloads or failure reasons.
App / Agent / Workflow
The original system turns job state and outputs into the next user-facing or automated step.
Example workflow
Example workflow
This pattern works when a Dify app should trigger a real remote job instead of trying to keep every execution step inside the app runtime.
A Dify app receives a user request and decides the task needs remote execution.
Dify calls Jungle Grid as an external API or tool.
Jungle Grid runs the requested inference, batch, or fine-tuning workload remotely.
Dify polls or receives status updates from Jungle Grid.
The app returns the final result to the user once Jungle Grid completes the job.
Code example
Submit a workload and track the job
This JavaScript example matches the kind of helper endpoint or API tool wrapper a Dify app could call when it needs to push a workload into Jungle Grid.
The important split is the same on every page: the integration tool decides when work should run, and Jungle Grid executes the workload remotely.
In this demo, /api/junglegrid/jobs is an app-side route or helper endpoint that forwards work to Jungle Grid. It is shown as integration glue code, not as a claim about a fixed official URL path.
The kind of job Jungle Grid should execute, such as inference, training, fine-tuning, or a batch run.
A rough sizing hint so Jungle Grid can match the workload to healthy capacity without manual GPU selection.
The container image Jungle Grid should launch for the workload.
The command executed inside the container when the job starts.
Use cases
Good fits for this pattern
This pattern is strongest when developers want to keep workflow logic inside the integration tool and avoid manually choosing GPUs, providers, or regions for each job.
AI apps that need heavier document, media, or model-processing jobs outside the interactive app path.
Agentic workflows where the app should call an external execution layer for batch or long-running work.
Dify-based demos or products that need tracked remote execution without exposing infrastructure choices to end users.
Copy for LLM
Prompt an LLM with the right layer split
This prompt keeps Dify in the orchestration role and Jungle Grid in the execution role so generated demos follow the intended architecture.
Prompt template for Dify demos
Use this prompt when you want an LLM to scaffold a reference integration without collapsing orchestration into the execution layer.
Build a demo that uses Dify for AI app and agent workflow orchestration and Jungle Grid for remote AI workload execution. The demo should submit a workload to Jungle Grid, poll job status, fetch logs, display results, and show failure/retry states. Use Jungle Grid as the execution layer, not as a replacement for Dify.FAQ
Frequently asked
Can Dify call Jungle Grid as an external tool or API?
Yes. That is the cleanest way to use Dify with Jungle Grid: Dify stays responsible for app logic and tool orchestration, while Jungle Grid runs the remote AI workload.
When should a Dify app hand work off to Jungle Grid?
Hand work off when a task becomes compute-heavy, batch-oriented, or long-running enough that it should run as a tracked remote job instead of inline inside the app workflow.
Does Jungle Grid replace the Dify app layer?
No. Dify still handles the AI app experience, prompts, tools, and workflow logic. Jungle Grid only takes over the remote execution slice.
Next step
Keep Dify focused on the app layer
Use Jungle Grid when a Dify application needs real remote execution for heavier jobs, while keeping prompts, workflows, and user interaction inside the app platform.