You can do it with the help of catchfile:
\begin{filecontents*}{\jobname-code.tex}
% https://tex.stackexchange.com/a/295354/
for tree={
grow'=east,
math content,
edge={->,>=latex},
if={isodd(n_children())}{
calign primary child/.pgfmath={(n_children()+1)/2},
calign=child edge,
}{}
},
forked edges
[T>T^0
[T>A_f
[C_a(T-A_f) <\sigma <C_a (T-A_s)
[ {\zeta_s^n=\zeta_s^0-\frac{\zeta_s^0}{\zeta^0}(\zeta^0-\zeta^n)} ]
[ {\zeta_T^n=\zeta_T^0-\frac{\zeta_T^0}{\zeta^0}(\zeta^0-\zeta^n)} ]
[{\zeta^n=\frac{\zeta^0}{2}(cos \big (\alpha_A(T-A_s-\frac{\sigma}{C_a})\big )+1)} ]
]
[\sigma<C_a(T-A_s)
[ {\zeta^n=\zeta^{n-1}} ]
[ {\zeta_s^n=\zeta_s^{n-1}} ]
[ {\zeta_T^n=\zeta_T^{n-1}} ]
]
]
[A_s<T<A_f
[\sigma<C_a(T-A_s)
[ {\zeta_s^n=\zeta_s^0-\frac{\zeta_s^0}{\zeta^0}(\zeta^0-\zeta^n)} ]
[ {\zeta_T^n=\zeta_T^0-\frac{\zeta_T^0}{\zeta^0}(\zeta^0-\zeta^n)} ]
[{\zeta^n=\frac{\zeta^0}{2}(cos \big (\alpha_A(T-A_s-\frac{\sigma}{C_a})\big )+1)}, calign with current]
[\sigma>C_a(T-A_s)
[ {\zeta^n=\zeta^{n-1}} ]
[ {\zeta_s^n=\zeta_s^{n-1}} ]
[ {\zeta_T^n=\zeta_T^{n-1}} ]
]
]
]
[T<A_s
[ {\zeta^n=\zeta^{n-1}} ]
[ {\zeta_s^n=\zeta_s^{n-1}} ]
[ {\zeta_T^n=\zeta_T^{n-1}} ]
]
]
\end{filecontents*}
\documentclass[border=10pt]{standalone}
\usepackage[edges]{forest}
\usepackage{catchfile}
\newcommand{\inputforest}[2][]{%
\begingroup
\CatchFileDef{\temp}{#2}{}%
\edef\temp{\endgroup
\unexpanded{\begin{forest}#1}%
\unexpanded\expandafter{\temp}%
\unexpanded{\end{forest}}%
}\temp
}
\begin{document}
\inputforest{\jobname-code}
\end{document}
Code courtesy of cfr. If you call it as \inputforest[<some forest code>]{file}, <some forest code> would be placed immediately before the file’s contents.

A different approach is with action character; thanks to cfr for suggesting it.
\documentclass[border=10pt]{standalone}
\usepackage[edges]{forest}
\usepackage{catchfile}
\newcommand{\inputforest}[2][@]{%
\begingroup
\bracketset{action character=#1}
\CatchFileDef{\temp}{#2}{}%
\begin{forest}#1\temp\end{forest}
\endgroup
}
\begin{document}
\inputforest[!]{\jobname-code}
\end{document}
Here the optional character is the “action character”: it should be one that doesn't appear in the forest code, default @.
[2[1][1]](on multiple lines). – tebartsch Jul 26 '17 at 06:44